Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Testing SMTP email calls
Message
From
04/01/2024 06:54:22
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Third party products
Title:
Testing SMTP email calls
Miscellaneous
Thread ID:
01687494
Message ID:
01687494
Views:
138
Likes (1)
I'm just getting started replacing an old email module I wrote for a client that doesn't seem to be working for their customers anymore.

For various reasons, choosing to do this with Chilkat and the new ChilkatVFP wrapper. I've figured out the code I need to create and send an email, but I'm struggling in testing it. When I tried to configure it to use the SMTP server associated with my Office365-based Exchange Server, I got authentication errors.

I poked around and found a cool site that provides a test SMTP server online so you can test email issues (https://www.wpoven.com/tools/free-smtp-server-for-testing). Even found a different site that lets you test sending via SMTP (https://smtpserver.com/smtptest). When I use the second site to send an email using the first site's server, the email goes through without error, so I know I've got the right SMTP settings.

But when I use my code to try to send via the first site, I time out. This is really simple code, just to make sure I can make it all work. After the necessary SET PATH and SET CLASSLIB, it's just:
loEmail = CREATEOBJECT('Email')
loEmail.Subject = 'This is a test'
loEmail.Body = [Here's some content.]
loEmail.From = 'tamar@istesting.com'
?loEmail.AddTo('tamar@didthiswork.com')

loMailMan = CREATEOBJECT('MailMan')
loMailman.smtphost = 'smtp.freesmtpservers.com'
loMailman.smtpport = 25
?loMailman.Sendemail(loEmail)
_cliptext = loMailMan.lasterrortext
The error message I get is:
ChilkatLog:
  SendEmail:
    DllDate: Oct 27 2023
    ChilkatVersion: 9.5.0.96
    UnlockStatus: 0
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 0
    Auto unlock for 30-day trial
    UnlockStatusMsg: Unlocked for 30-day trial
    UnlockStatus: 1
    sendEmailInner:
      ReadTimeout: 30000
      renderToMime_pt1:
        createEmailForSending:
          Auto-generating Message-ID
        --createEmailForSending
      --renderToMime_pt1
      sendMimeInner:
        ensureSmtpSession:
          ensureSmtpConnection:
            smtpParams:
              SmtpHost: smtp.freesmtpservers.com
              SmtpPort: 25
              SmtpUsername: 
              SmtpSsl: 0
              StartTLS: 0
            --smtpParams
            smtpConnect:
              smtpHostname: smtp.freesmtpservers.com
              smtpPort: 25
              connectionIsReady:
                SMTP host changed.
                Need new SMTP connection...
              --connectionIsReady
              smtpSocketConnect:
                socket2Connect:
                  connect2:
                    connectSocket_v2:
                      connect_domain:
                        Connection attempt failed.
                        maxWaitTimeMs: 30000
                        totalMsWaitedSoFar: 17550
                        Failed.
                      --connect_domain
                    --connectSocket_v2
                    ConnectFailReason: Connection rejected
                    A few possible causes for a connection being rejected are:
                    - A firewall (software or hardware), such as Windows Firewall, is blocking the connection .
                    - Nothing is listening at the remote host:port
                  --connect2
                --socket2Connect
                Failed to connect to SMTP server..
              --smtpSocketConnect
            --smtpConnect
          --ensureSmtpConnection
        --ensureSmtpSession
      --sendMimeInner
    --sendEmailInner
    Failed.
  --SendEmail
--ChilkatLog
Any suggestions about what I'm missing here?

Tamar
Next
Reply
Map
View

Click here to load this message in the networking platform