PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Sending email via a GoDaddy account
Sending email via a GoDaddy account
Débuté par Simon Phillips, 08 nov. 2020 14:30 - 3 réponses
Posté le 08 novembre 2020 - 14:30
Hi all

I'm just set up a new email account with GoDaddy, but although I can receive emails, it will not send them.

I've used exactly the same code (except the user, password etc) with an@outlook.com account and it works perfectly.

The code is as follows:

MySession is emailSMTPSession
MySession..ServerAddress = "smtp.office365.com"
MySession..Option = emailOptionSecuredTLS
MySession..Port = 587
MySession..Name = "simon@otterreg.com"
MySession..Password = "*******"
IF EmailStartSession(MySession) = False THEN
Error("Unable to start the SMTP session.", ErrorInfo(), ...
"In case of time-out, check the parameters of the " + ...
"""Firewall"" on the port used (" + ...
MySession..Port + ")")
else
// Build an email
MyMessage is Email
MyMessage..SenderAddress ="simon@otterreg.com"
MyMessage..Sender = "Simon Phillips"
Add(MyMessage..Recipient, "sdpxox@outlook.com")
MyMessage..Subject = "Test From OtterReg"
MyMessage..Message = "Text from conntact us page on OtterReg.com "

// Send the message
EmailSendMessage(MySession, MyMessage)
end

It fails on the EmailStartSession(MySession). Has anyone else used GoDaddy for their email and had the same problem?

Also, I have tried sending emails from Thunderbird and again can receive but not send. However, if I set it up in Outlook, it works both sending and receiving!!

Anyone got any experience of this and if so could you let me know whilst I still have some hair left.

Thanks
Simon Phillips
Posté le 08 novembre 2020 - 16:44
Hi all

Having spent until 1:30 in the morning I have finally solved it. It does not help that the GoDaddy customer support gave me the wrong smtp server!

If anyone else has the same problem, then the settings are as follows:

MySession..ServerAddress = "smtpout.secureserver.net"
MySession..Option = emailOptionSecuredTLS
MySession..Port = 587
MySession..Name = "simon@otterreg.com"
MySession..Password = "********"

EmailStartSession(MySession)

Hope this helps. Time to go to sleep!

Simon Phillips
Posté le 09 novembre 2020 - 06:55
EmailStartSession returns false if it fails. From the help:

<Result>: Boolean
True if the session was started,
False otherwise. The ErrorOccurred variable is set to True if an error occurs.
To find out the wording of the error, use a function ErrorInfo with the constant errMessage.

I don't know the error message but since you did not mention one I assume you were not checking the ErrorInfo.
Membre enregistré
27 messages
Posté le 21 septembre 2021 - 15:56
Hi Simon,

Can you try
Email.Recipient = "sdpxox@outlook.com"

instead of
Add(MyMessage..Recipient, "sdpxox@outlook.com")

Regards Henk