LOCAL loConfig AS CDO.Configuration, loFlds AS Object, loMsg AS CDO.Message loConfig = CREATEOBJECT("CDO.Configuration") loFlds = loConfig.Fields WITH loFlds *- Set the CDOSYS configuration fields to use port 25 on the SMTP server. .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 *- Enter name or IP address of remote SMTP server. .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.yahoo.com" && "smtp.gmail.com" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 && 467 *- Assign timeout in seconds .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 20 .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = .t. && .f. .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username" .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="password" .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 .Update() ENDWITH *- Create and send the message. loMsg = CREATEOBJECT("CDO.Message") WITH loMsg .Configuration = loConfig .To = "sur200@indiatimes.com" .From = "username@yahoo.com" .Subject = "This is a test of CDO sending e-mail" .HTMLBody = "This is the HTML content of the mail message" TRY .Send() MESSAGEBOX("Email Sent Successfully") CATCH TO oerr MESSAGEBOX(SUBSTR(oerr.message,AT(":",oerr.message)+1,LEN(oerr.message))) ENDTRY ENDWITH