the strange thing is that I have used the library.SendMail() method in a usercontrol (.ascx) without any problems. The only difference is that here, the library.SendMail() method is used in an event handler.
The problem was due to the fact that I was using the same emailaddress for the fromEmail and toEmail parameters in the library.SendMail() method. Changed the fromEmail parameter to another email address and now the library method is working fine.
problem with library.Sendmail() method
Hi,
I'm having a problem the library.Sendmail(string FromMail, string ToMail, string Subject, string Body, bool IsHtml)
My code looks like this:
library.SendMail("mymailaddress", "mymailaddress", "job published", body, true);
However the mail is only sent when I use a hardcoded string for the body parameter, for example:
library.SendMail("mymailaddress", "mymailaddress", "job published", "some body text", true);
the value of my body variable is:
<p>Dear James Ewing</p><p>Your job truck driver has been approved and published on <a href='http://www.safetatwork.com'>www.safetatwork.com</a></p>
Has anyone encountered this problem yet, or do you know what the issue could be?
Thanks for your help,
Anthony
the strange thing is that I have used the library.SendMail() method in a usercontrol (.ascx) without any problems. The only difference is that here, the library.SendMail() method is used in an event handler.
found the issue,
The problem was due to the fact that I was using the same emailaddress for the fromEmail and toEmail parameters in the library.SendMail() method. Changed the fromEmail parameter to another email address and now the library method is working fine.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.