PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Sending Email using SMTP of Goolge does not work
Sending Email using SMTP of Goolge does not work
Iniciado por guest, 01,ene. 2015 15:30 - 3 respuestas
Publicado el 01,enero 2015 - 15:30
I am trying to send email to user using following code:
gSessionSMTP is EmailSMTPSession gSessionSMTP..ServerAddress="smtp.gmail.com" gSessionSMTP..Name=gsUser gSessionSMTP..Password=gsPassword gSessionSMTP..Port=587 gSessionSMTP..Option=optionSecureTLS //Content of the email AnEmail is Email object AnEmail..SenderAddress=gsUser AnEmail..Recipient[1]=gsSendTo AnEmail..Subject = "Thank your giving Business to us" AnEmail..Message = gsMailBody //Send the email IF EmailStartSession(gSessionSMTP)=True THEN IF EmailSendMessage(gSessionSMTP,AnEmail)=False THEN Error("Failure sending the email.",ErrorInfo(errMessage)) END ELSE Error("Unable to establish the connection", ErrorInfo(errMessage)) END
What is wrong with this code.

It keeps on failing.

The above code that I am currently using is copied from WinDev's Help and modified as per my needs.

TIA

Yogi Yang
Publicado el 01,enero 2015 - 16:05
Yogi,

Check out this forum question

<a class="ExternalLink" rel="nofollow" target="_blank" href="http://27130.foren.mysnip.de/read.php?27131,490891,493554#msg-493554">http://27130.foren.mysnip.de/read.php&hellip;</a>

There is code of me that works with gmail smtp in one of the replies to that question.

Danny
Publicado el 05,enero 2015 - 11:27
Danny,

Thanks for the link. I will check it out.
Publicado el 05,enero 2015 - 14:29
Hi Yogi,
you will have to change a setting on your gmail account.
Enable -> "Access for less secure apps" and everything will work fine.

It is a common problem

Steven Sitas