tcgeo wrote on Oct 31
st, 2009 at 1:22am:
The following code works great to send an email.
vSubject = Coachmessage
vFromEmail = "myemail.net"
vToEmail = vCEmail
vCBody = coachmessage
iia = @SendMail("smtp.charter.net", vSubject, vFromEmail, vToEmail, "", "", vCBody, "", "", "")
I’d like to change vSubject to accept variables like shown below, so that it would become “automatic” if you will. When I do change it, it works great, but then the body area of the email designated as vCBody here, does not work any longer (Does not get emailed) although the email does get sent.
vSubject = ("Dear coach" + " " + vCLast + " " + "please call these players")
The outside parentheses are not necessary in the line above. They don't cause a problem, but I am curious as to why you are using them.
Quote:
iia = @SendMail("smtp.charter.net", vSubject, vFromEmail, vToEmail, "", "", vCBody, "", "", "")
It almost seems as though there’s not enough time for Sesame to “grab” both the vSubject data and the vCBody data before the emailing takes place.
I don't see anything specifically wrong there, but I doubt timing is an issue. Some mail servers do set a timeout for communications, but the @SendMail command would return an error indicating that the connection timed out. Use a bunch of WriteLn commands to show you the value of the data you are sending. If nothing wrong is seen, double (and triple) check that all of your quotes and commas are in the right places. With ten arguments, many of which are optional, it isn't difficult to get a comma or a double quote out of sorts.
Quote:Also, when I address the email to more than one recipient dividing the addresses using a “;” it works sporadically. In other words, sometimes the email goes through and other times it does not. Could this be a timing thing also?
Thanks for any help with this.
As I said above, almost certainly not a timing issue. Instead of placing multiple email addresses in the ToAddr argument (which should be just one main recipient), place them in either the CC or the BCC arguments. The entire email, header and all, is sent as a whole from Sesame to your email server. So if your server does not like having multiple addresses specified in the main ToAddr, it may set the rest of the email header and body out of whack.