Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Anthony Candaele 1197 posts 2049 karma points
    Feb 05, 2012 @ 15:17
    Anthony Candaele
    0

    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

  • Anthony Candaele 1197 posts 2049 karma points
    Feb 05, 2012 @ 15:29
    Anthony Candaele
    0

    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.

  • Anthony Candaele 1197 posts 2049 karma points
    Feb 05, 2012 @ 15:35
    Anthony Candaele
    0

    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.

  • 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.

Please Sign in or register to post replies