SendCDOMail() FUNCTION SendCDOMail() SET STEP ON LOCAL loCDOMesage AS CDO.Message LOCAL loCDOConfig AS CDO.Configuration lcSchema = [http://schemas.microsoft.com/cdo/configuration/] loCDOConfig = CREATEOBJECT([CDO.Configuration]) WITH loCDOConfig.FIELDS .ITEM(lcSchema + [smtpserverport]) = 25 .ITEM(lcSchema + [sendusing]) = 2 .ITEM(lcSchema + [smtpserver]) = "smtp.freesmtpservers.com" .ITEM(lcSchema + [smtpauthenticate]) = 0 .ITEM(lcSchema + [sendusername]) = "" .ITEM(lcSchema + [sendpassword]) = "" .ITEM(lcSchema + [smtpusessl]) = .f. .UPDATE() ENDWITH loCDOMesage = CREATEOBJECT([CDO.Message]) loCDOMesage.Configuration = m.loCDOConfig loCDOMesage.BodyPart.Charset = "utf-8" WITH loCDOMesage .From = "from@somemail.com" .To = "to@somemail.com" .Subject = "This is a test" .HTMLBody = "Test of the body contets" .HTMLBodyPart.Charset = "utf-8" .TextBodyPart.Charset = "utf-8" TRY .Send() CATCH TO oError MesageBox(oError.Message) ENDTRY ENDWITH loCDOMesage = NULL loCDOConfig = NULL RELEASE loCDOConfig, loCDOMesage RETURN ""***** UPDATE
>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 >>
>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 >>