Web Connection
wwsmtp
Hi Rick,
I can't send an email using name.com server with wwsmtp (i used wwsmtp with godaddy etc working fine), not sure what am i missed, but the same setting works with cdo2000.fxp. can you help here?
Thanks, Jouffroy Lee
cdo2000
clear
LOCAL loMail
loMail = NEWOBJECT("Cdo2000") && , "Cdo2000.fxp")
WITH loMail
.lUseSSL = .t.
.nAuthenticate = 1 && cdoBasic
.cUserName = "jeff@williamwuteam.com"
.cPassword = "jeff@williamwuteam.com"
.cServer = "hs4.name.com"
.cFrom = "jeff@williamwuteam.com"
.nServerPort = 465
.cTo = "jensen928@outlook.com"
.cSubject = "smtp test"
.cTextBody = "from 2000"
ENDWITH
IF loMail.Send() > 0
lcReturn=''
FOR i=1 TO loMail.GetErrorCount()
lcReturn=lcReturn+CHR(13)+CHR(10)+ALLTRIM(STR(i))+':'+loMail.Geterror(i)
ENDFOR
loMail.ClearErrors()
WAIT WINDOW SUBSTR(lcReturn,3)
ELSE
?"Email sent."
ENDIF
wwsmtp
clear
DO wwSmtp && load libraries
LOCAL loSMTP as wwSmtp
loSmtp=CREATEOBJECT("wwSmtp")
* loSmtp.nMailMode = 0 && wwIPStuff mode (Win32 - default) 0 - .NET wwSmtp
loSmtp.nMailMode = 2 && wwIPStuff mode (Win32 - default) 0 - .NET wwSmtp
loSmtp.cMailServer="hs4.name.com"
loSmtp.nserverPORT=465
loSmtp.lUseSsl = .t.
loSmtp.cSenderEmail="jeff@williamwuteam.com"
loSmtp.cSenderName="jeff@williamwuteam.com"
loSmtp.cUsername = "jeff@williamwuteam.com"
loSmtp.cPassword = "jeff@williamwuteam.com"
loSmtp.cRecipient="jensen928@outlook.com"
loSmtp.cSubject="wwSmtp Test Message"
loSmtp.cContentType = "text/html"
loSmtp.cMessage="<b>difficult</b>?"
llResult = loSmtp.sendmail()
?llResult
IF !llResult
?loSmtp.cErrorMsg
ENDIF
Your CDO code uses a pre-set connection that you've previously configured.
I'd check and make sure that:
- you can send email through that same account with another mail client (outlook, windows mail, thunderbird)
- double check all the settings for the connection: Port, SSL, username and password
Your code uses the username for password and pretty sure that's not right... You'll need to provide your mail account password.
+++ Rick ---