Welcome! Log In Create A New Profile

Advanced

Error when sending mail using variable

Posted by Tom Gyssels 
Tom Gyssels
Error when sending mail using variable
January 31, 2012 03:42PM
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 <helpdesk@domain.com>"
MyEmail..SenderAddress="helpdesk@domain.com"
IF ArrayCount(MyEmail.Recipient)>0 THEN
	IF NOT EmailSendMessage("HelpdeskSend",MyEmail,True) THEN
		Debug("<WIN_SendMail>"+"Mail kon niet verzonden worden"+ErrorInfo(errFullDetails))
	ELSE
		Debug("<WIN_SendMail>"+"Mail met succes verzonden")
	END
END
EmailCloseSession("ReportSend")
RESULT MyEmail
Jose Antonio Garrido
Re: Error when sending mail using variable
August 25, 2012 02:02AM
Hi.

Didn't try in WD 16, but in WD 17 IT WORKS:
-using SMTP or Outlook session
-usuing email variable or email structure.

What it doesnt work is to read messageID from outlook emails, or to set messageID and send the email throught outlook.
I wrote PCSOFT about that problem three months ago, and i think it is very important to identify the emails you send or recive in outlook.



Edited 1 time(s). Last edit at 08/25/2012 02:07AM by Jose Antonio Garrido.
Allard
Re: Error when sending mail using variable
June 30, 2013 11:34PM
In webdev 18 sending mails is ok ( php modus ). I used a procedure in the code of the mail sending , then, Faults appeard. I removed the procudure and added all code in one section and it worked like a charm??

regards

Allard
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: