the send mail example that comes Macro Sheduler keeps reporting an error: 501 5.5.4 Invalid Address.
????
I have testet the mailserver throught telnet. no problems there
The server is an Exchange2003 is this a problem.
SmtpSendMail
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
It's one of the examples that comes with macro sheduler. But here it comes:
MessageModal>This macro demonstrates how to send Email & Files using the SMTPSendMail command.
Input>smtp,Please Enter Your SMTP Mail Server:
If>smtp=,end
Input>fromname,Please Enter Your Name:
If>fromname=,end
Input>fromemail,Please Enter Your Email Address:
If>fromemail=,end
Input>toemail,Please Enter Recipient's Email Address:
If>toemail=,end
Input>subject,Please Enter a Subject:
Input>msg,Please Enter Your Message:
Ask>Do you want to send a file?,sendfile
Let>attach=
If>sendfile=NO,continue
Input>attach,Please browse for the file you want to send
Label>continue
SMTPSendMail>toemail,smtp,fromemail,fromemail,subject,%msg%,attach
MessageModal>SMTP_RESULT
Label>end
exit
MessageModal>This macro demonstrates how to send Email & Files using the SMTPSendMail command.
Input>smtp,Please Enter Your SMTP Mail Server:
If>smtp=,end
Input>fromname,Please Enter Your Name:
If>fromname=,end
Input>fromemail,Please Enter Your Email Address:
If>fromemail=,end
Input>toemail,Please Enter Recipient's Email Address:
If>toemail=,end
Input>subject,Please Enter a Subject:
Input>msg,Please Enter Your Message:
Ask>Do you want to send a file?,sendfile
Let>attach=
If>sendfile=NO,continue
Input>attach,Please browse for the file you want to send
Label>continue
SMTPSendMail>toemail,smtp,fromemail,fromemail,subject,%msg%,attach
MessageModal>SMTP_RESULT
Label>end
exit
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
The sample code uses the From Email info for both the FromAddress and FromName values.
But it seems that not all SMTP servers can use the From email address as the From name. For example my smtp server uses [email protected] for the fromaddress, but only uses myname for the fromname.
Change from:
SMTPSendMail>toemail,smtp,fromemail,fromemail,subject,%msg%,attach
Change to:
SMTPSendMail>toemail,smtp,fromemail,fromname,subject,%msg%,attach
And add another prompting line at the top section, perhaps right after the prompt for the Server name.
Insert:
Input>fromname,Please Enter Your Server Account Name:
If>fromname=,end
If your smtp server uses the same format I described, then you can eliminate adding the second prompt, but parse the From Email name to provide the %fromname% for you.
But it seems that not all SMTP servers can use the From email address as the From name. For example my smtp server uses [email protected] for the fromaddress, but only uses myname for the fromname.
Change from:
SMTPSendMail>toemail,smtp,fromemail,fromemail,subject,%msg%,attach
Change to:
SMTPSendMail>toemail,smtp,fromemail,fromname,subject,%msg%,attach
And add another prompting line at the top section, perhaps right after the prompt for the Server name.
Insert:
Input>fromname,Please Enter Your Server Account Name:
If>fromname=,end
If your smtp server uses the same format I described, then you can eliminate adding the second prompt, but parse the From Email name to provide the %fromname% for you.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?