Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 6 Jahren, 6 Monaten
Letzter Beitrag:
vor 6 Jahren, 6 Monaten
Beteiligte Autoren:
Tom Gyssels, Khatir METAHRI.pcs.crosspost, Arie

Sending mail using variable, "unable to send message without specifying sender"

Startbeitrag von Tom Gyssels am 31.01.2012 14:16

Whenever I try to send an email using an email variable, I get the error "unable to send message without specifying sender".
This problem does not occur when using the email structure, but I need the variable because I need to pass it further around.
This is my current code, in which I clearly specify the sender.

PROCEDURE loc_SendMail()
LOCAL
recipients is array of string
MyEmail is Email

IF NOT EmailStartSMTPSession("HelpdeskSend","","relay.skynet.be") THEN
RESULT Null
END
EDT_Recipient=Replace(EDT_Recipient,";",",")
StringToArray(EDT_Recipient,recipients,",")
FOR EACH sRecip OF recipients
ArrayAdd(MyEmail.Recipient,sRecip)
END
MyEmail.Subject=EDT_Subject
MyEmail.HTML=EDT_Content
FOR EACH ROW OF LOOP_Attachments
EmailLoadAttachment(MyEmail,LOOP_Attachments.ATT_AttPath)
Debug("Added mail attachment: "+LOOP_Attachments.ATT_AttPath)
END
MyEmail..Sender="Helpdesk "
MyEmail..SenderAddress="helpdesk@domain.com"
IF ArrayCount(MyEmail.Recipient)>0 THEN
IF NOT EmailSendMessage("HelpdeskSend",MyEmail,True) THEN
Debug(""+"Mail kon niet verzonden worden"+ErrorInfo(errFullDetails))
ELSE
Debug(""+"Mail met succes verzonden")
END
END
EmailCloseSession("ReportSend")
RESULT MyEmail

Antworten:

Tom,
did you already debug this code by using a breakpoint an see if all variables get filled indeed?

Just a guess:
FOR EACH sRecip OF recipients
should be
FOR EACH sRecip OF recipients SEPARATED BY ","
???

von Arie - am 31.01.2012 15:20

Re: Sending mail using variable, "unable to send message without specifying sender" (no replies)

I think you must use a EmailSessionSMTP variable

Message forwarded from pcsoft.us.windev

von Khatir METAHRI.pcs.crosspost - am 31.01.2012 15:23

Re: Sending mail using variable, "unable to send message without specifying sender" (no replies)

Thank you Khatir, that did the trick. It still does not make sense though.

von Tom Gyssels - am 31.01.2012 15:39
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.