SytzedeBoer
Programmer
Can anyone help me with a real problem I have
I will post the code below.
This is working fine for me if the smtp is smtp.gmail.com
I need this to also work with Yahoo and Outlook.com
With these two I get all kinds of spurious errors
loMail = NEWOBJECT("Cdo2000", "Cdo2000.fxp")
GO TOP IN Winkiss
gm1=winkiss.opt17 &&my email address
gm2=winkiss.empw && e.g. gmail password
gm3=ALLTRIM(winkiss.portnum)
IF EMPTY(gm3)
gm3="465"
endif
WITH loMail
.cServer = ALLTRIM(winkiss.opt15) && e.g. smtp.gmail.com
.nServerPort = 465
.lUseSSL = .T.
.nAuthenticate = 1 && cdoBasic
.cUserName = gm1
.cPassword = gm2
.cFrom = gm1
.cTo = "sytze@kiss.co.nz"
.cSubject = "CDO 2000 email through SMTP server "
.cTextBody = "This is a text body."
* .cAttachment = "myreport.pdf, myspreadsheet.xls"
ENDWITH
IF loMail.Send() > 0
FOR i=1 TO loMail.GetErrorCount()
? i, loMail.Geterror(i)
ENDFOR
loMail.ClearErrors()
ELSE
WAIT WINDOW NOWAIT "Your email was sent"
ENDIF
I will post the code below.
This is working fine for me if the smtp is smtp.gmail.com
I need this to also work with Yahoo and Outlook.com
With these two I get all kinds of spurious errors
loMail = NEWOBJECT("Cdo2000", "Cdo2000.fxp")
GO TOP IN Winkiss
gm1=winkiss.opt17 &&my email address
gm2=winkiss.empw && e.g. gmail password
gm3=ALLTRIM(winkiss.portnum)
IF EMPTY(gm3)
gm3="465"
endif
WITH loMail
.cServer = ALLTRIM(winkiss.opt15) && e.g. smtp.gmail.com
.nServerPort = 465
.lUseSSL = .T.
.nAuthenticate = 1 && cdoBasic
.cUserName = gm1
.cPassword = gm2
.cFrom = gm1
.cTo = "sytze@kiss.co.nz"
.cSubject = "CDO 2000 email through SMTP server "
.cTextBody = "This is a text body."
* .cAttachment = "myreport.pdf, myspreadsheet.xls"
ENDWITH
IF loMail.Send() > 0
FOR i=1 TO loMail.GetErrorCount()
? i, loMail.Geterror(i)
ENDFOR
loMail.ClearErrors()
ELSE
WAIT WINDOW NOWAIT "Your email was sent"
ENDIF