Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
11
Erster Beitrag:
vor 2 Jahren, 1 Monat
Letzter Beitrag:
vor 2 Jahren, 1 Monat
Beteiligte Autoren:
Joel, Bart VDE, Allard, Fabrice Harari, Peter Holemans

WB-20 - email work on development machine, but not server

Startbeitrag von Joel am 11.01.2016 17:35

HI all -

I've got a weird problem here I could use some suggestions on. My "send email" function just started throwing an error. I didn't change anything there recently. And the weird thing - it works on my development machine, but not once I upload it to the server. Nothing has changed in that area. I re-uploaded the App to the server - nothing. I rebooted the server - still no change. I'm not sure how to proceed. Any ideas anyone?

Antworten:

HEre's the error - there are sender emails...

Unable to send message without specifying sender.
WL call:
Process of 'Method SendEmail' (clEmail.SendEmail), line 53, thread 0
'EmailSendMessage' function, syntax 9

What happened?
Unable to send message without specifying sender.

Error code: 100124
Level: fatal error (EL_FATAL)

Dump of the error of 'wd190com.dll' module (19.0.78.0).
Debugging information:
Fonction (10,14)
Additional Information:
EIT_PILEWL :
Method SendEmail (clEmail.SendEmail), line 53
Click of Lnk_Email ( CELL_CreateCommHeader ) (server) (PAGE_Comm_CreateAndSendOrPrint.CELL_CreateCommHeader.Lnk_Email), line 50
Click of Lnk_SendToSelected ( CELL_Cell1 ) (server) (PAGE_StaffCenter.CELL_Cell1.Lnk_SendToSelected), line 28
EIT_DATEHEURE : 11/01/2016 19:03:51

(25, ERR_MSG_BOX)

von Joel - am 12.01.2016 00:04
Hi Joel,

This may be a security change on your smtp server.
Most smtp servers require that the sender's email address is provided.
So make sure you completed the email.sender="a.b@some.where" with a valid email address.

Cheers,

Peter Holemans

von Peter Holemans - am 12.01.2016 08:25
Hi Joel

if you are using gmail for smtp, please be aware that they have been tightening the security screws and now REQUIRE that the sender field contains the EMAIL ADDRESS, not simply your name

Best regards

von Fabrice Harari - am 12.01.2016 12:23
Hi Guys - and thanks for the responses. I followed my code and the sender email address is def. there all the way through. I learned something else - it doesn't always work on my dev. machine either. But I notice when I step through the code line by line, it does seem to always work. I've seen this problem before, but never quite understood how I've fixed it in the past. I'm starting to think it's something weird in the application servers?

von Joel - am 12.01.2016 18:27
I just traced the sender address and, the trace shows the sender email is there for each email that gets sent out. And of course it works just fine - again with the Dev. machine - but with the trace in there. ???

von Joel - am 12.01.2016 18:34
Hi Again -

I found an issue, but not the problem. A little initialization routine that was supposed to use smtp.gmail was not running so I was using stmp.1and1.com instead. I thought maybe that was it, made sure the routine was running, loaded it all up to the server, but no. Same problem. As I step through the program on the dev. machine, I see that the sender's email address is there. I am really lost - any other suggestions?

von Joel - am 12.01.2016 21:03
Hi,

You profided the error . If you profide the code that does the actual email sending we could have a look at that

regards

Allard

von Allard - am 12.01.2016 21:29
Here is the routine I use to send emails. Again - it was working fine. Only works (sometimes) on dev. machine now. Notice I put in the "Trace" statement to list that I have been including the "sender address". It shows the sender address is there when it's run. Any suggestions appreciated!

PROCEDURE SendEmail(spar_RecipientEmail is string, spar_Subject is string,...
spar_Body is string, spar_SenderEmail is string, spar_Attachment is string, npar_NbAttach is numeric)

sSenderEmail is string =NoSpace(spar_SenderEmail)
sRecipientEmail is string=NoSpace(spar_RecipientEmail)
sSubject is string=spar_Subject
sBody is string=spar_Body

MySession is EmailSMTPSession
MySession.ServerAddress = :m_sSMTPServerAddress
MySession.Name = :m_sSMTPServerUserName
MySession.Password = :m_sSMTPServerPassword
MySession.Port = :m_iSMTPServerPort

EmailSetTimeOut(10)

//Open the Session
IF NOT EmailStartSession(MySession) THEN
Error("Cannot open SMTP connection",ErrorInfo(),"In case of a time-out, check the parameters of the firewall on the port used("+MySession.Port+")")
RETURN
END

// Initializes the components of the email
Email.Sender = sSenderEmail // The sender
Trace(spar_SenderEmail, spar_RecipientEmail) //for testing
Email.Recipient[1] = sRecipientEmail // The recipient
Email.NbRecipient = 1 // The number of recipients
Email.Subject = sSubject // The subject
Email.Message = HTMLToText(sBody) // The body of the message
Email.HTML = sBody
Email.NbAttach = npar_NbAttach // The number of attachments
Email.Attach = spar_Attachment

IF EmailSendMessage(MySession) THEN
:m_bEmailSentOK = True
ELSE
:m_bEmailSentOK = False
END

EmailCloseSession(MySession)

von Joel - am 14.01.2016 18:07
Hi Joel,

You could try with adding the following :

Email.SenderAddress=sSenderEmail

Regards,
Bart

von Bart VDE - am 15.01.2016 16:14
Wow. Thank you so much! I don't believe it - I didn't know there was more than one "Sender" variable. I wonder why it just stopped working the old way - I guess it's like you said - they tightened up their security rules.

Thanks Again everyone!

J

von Joel - am 15.01.2016 22:11
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.