SmtpSendMail

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
asdf@asdf
Newbie
Posts: 9
Joined: Thu Mar 09, 2006 2:43 pm

SmtpSendMail

Post by asdf@asdf » Fri Mar 10, 2006 11:58 am

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.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Mar 10, 2006 2:37 pm

Would be helpful to see the script you are using with the SMTP line and its variable definitions.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

asdf@asdf
Newbie
Posts: 9
Joined: Thu Mar 09, 2006 2:43 pm

Post by asdf@asdf » Mon Mar 13, 2006 8:26 am

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

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Mar 13, 2006 4:54 pm

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.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Mar 13, 2006 10:37 pm

Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

asdf@asdf
Newbie
Posts: 9
Joined: Thu Mar 09, 2006 2:43 pm

Post by asdf@asdf » Tue Mar 14, 2006 8:15 am

Bob your right. it was a problem with the "fromname" being an email.
Thanks
it works now.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts