How does one set the body of an email?

Post Reply
Message
Author
Milenko
Posts: 94
Joined: Sun Jan 16, 2011 10:09 am

How does one set the body of an email?

#1 Post by Milenko » Mon Nov 07, 2011 7:46 pm

I'm not clear on how to set the body of an email when running from a script.

I can run "Email.Run Method.Send Email.TO.myemail@mydomain.com" but I'm not sure what else I'm missing.

User avatar
bwoodworth
Site Admin
Posts: 1563
Joined: Tue May 04, 2010 6:49 am
Location: California

Re: How does one set the body of an email?

#2 Post by bwoodworth » Mon Nov 07, 2011 8:30 pm

The second parameter is the body of the email.

Email.Run Method.Send Email.to.myemail@gmail.com."this is the body of the email"
Brian

Milenko
Posts: 94
Joined: Sun Jan 16, 2011 10:09 am

Re: How does one set the body of an email?

#3 Post by Milenko » Tue Nov 08, 2011 6:30 am

Gotcha, thanks very much. I'm going to add this to the wiki since I couldn't find any examples there of what the command was.

Milenko
Posts: 94
Joined: Sun Jan 16, 2011 10:09 am

Re: How does one set the body of an email?

#4 Post by Milenko » Wed Nov 09, 2011 6:26 pm

I just finally got around to testing this and it's not working.

I'm using the following in a script:

Code: Select all

Email.Run Method.Send Email.To.myemail@gmail.com."The temperature is now [General Thermostat V2 - Z4.Temperature]"
When it fires, the script seems to run but no email is sent. The following shows up in the email.log file:

Code: Select all

11/09/2011 09:24:31.909 PM - Error Sending email - The specified string is not in the form required for an e-mail address. -

User avatar
bwoodworth
Site Admin
Posts: 1563
Joined: Tue May 04, 2010 6:49 am
Location: California

Re: How does one set the body of an email?

#5 Post by bwoodworth » Wed Nov 09, 2011 6:37 pm

Sorry about that. It should be a comma between the two parameters, not a period. Like this:

Email.Run Method.Send Email.to.myemail@gmail.com,"this is the body of the email"
Brian

Milenko
Posts: 94
Joined: Sun Jan 16, 2011 10:09 am

Re: How does one set the body of an email?

#6 Post by Milenko » Wed Nov 09, 2011 6:55 pm

lol, got this all ironed out now. You also don't put the "To" in either. So the actual syntax that works is:

Code: Select all

Email.Run Method.Send Email.myemail@gmail.com,"The temperature is now [General Thermostat V2 - Z4.Temperature]"
Thanks for your help! I'll go update the wiki with this info now.

Vaughn
Site Admin
Posts: 1432
Joined: Thu May 13, 2010 2:17 pm

Re: How does one set the body of an email?

#7 Post by Vaughn » Thu Nov 10, 2011 8:13 pm

Thanks for the Wiki updates, really appriciate them!


Vaughn

Post Reply