PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → Sending Email SMTP - Strange Results
Sending Email SMTP - Strange Results
Started by Mister VINCENT, Jan., 06 2017 1:05 AM - 1 reply
Registered member
19 messages
Posted on January, 06 2017 - 1:05 AM
I am sending eMail from an application. The code works and eMail is sent from the application and received quickly on the other end. But the code is indicating that the eMail was not sent, even though it is arriving. The sender also is not correct, indicating that it is being sent by the gSessionSMTP..Name instead of the sUser. The code follows and, if anyone has the time, perhaps you might take a look at it. I've followed the debugger and everything appears to be good.

sUser is string = EDT_Email // value input on the screen
sRecipient is string = "sassy@gmail.com"
sSubject is string = "Request For Help"
sMessage is string = EDT_Message
sBCC is string = ""
// Session SMTP
gSessionSMTP is EmailSessionSMTP
gSessionSMTP.ServerAddress = "smtp.gmail.com"
gSessionSMTP..Name = "sassybiz@gmail.com"
gSessionSMTP..Password = "Judge014"
gSessionSMTP..Port = 587
gSessionSMTP..Option = emailOptionSecuredTLS

// Content of the eMail
MyMessage is Email
MyMessage..Sender = sUser
MyMessage..Recipient[1] = sRecipient
MyMessage..Subject = sSubject
MyMessage..Message = sMessage
MyMessage..HTML = MyMessage..Message

// Send the eMail
IF EmailStartSession(gSessionSMTP) = True THEN
IF EmailSendMessage(gSessionSMTP, MyMessage) = True THEN
ELSE
Error("The error is : ", ErrorInfo(errFullDetails)) // fails here but sends the eMail
END
ELSE
Error("Unable to establish a connection", ErrorInfo(errMessage))
Info(ErrorInfo(errMessage))
END

EmailCloseSession(gSessionSMTP)
Reset()

Thanks
Vincent C

--
Vincent D Crosby
Registered member
19 messages
Posted on January, 06 2017 - 1:51 AM
I think I've answered my own dilema. I am trying to do something that can't be done, make it look like the eMail is coming from the requestor. Since my account is making all this possible, then it has to be my account that is doing the sending. I understand that NOW.

But, running the code under WEBDEV 17, I appear to have an error in the sending but the message goes anyway. Running the code under WINDEV 21, there is no error.

Can't figure out why?????

--
Vincent D Crosby