Copied to clipboard

Flag this post as spam?

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


  • Chizzl 36 posts 107 karma points
    Nov 21, 2012 @ 11:39
    Chizzl
    0

    Contact Us Form issue - A from address must be specified

    Hi,

    The contact us form gave me the following error;

    A from address must be specified.

    I had to add the following line of code into the App_Code/ContactController.cs file 

    mailMessage.From = new MailAddress("[email protected]", "Dum Dummy");

    in the SendSmptEmail method (r.85) to get it working.

  • Stephen Davidson 216 posts 392 karma points
    Nov 28, 2012 @ 11:53
    Stephen Davidson
    0

    A small point but if you use the following line instead

     mailMessage.From = new MailAddress(senderEmail);

    Then whatever you speciify in the backend for "Sender Email Address" will be the addess thats used.

    Regards,

    S

  • Chizzl 36 posts 107 karma points
    Nov 28, 2012 @ 12:05
    Chizzl
    0

    Did you actually try this?  I can remember trying that first... but for some reason I came up with the code above. (But could be it was something else...)

  • Stephen Davidson 216 posts 392 karma points
    Nov 28, 2012 @ 12:46
    Stephen Davidson
    0

    Yeah all working and email being sent...at first i (stupidly) used the actual alias name of the property...the only other stumbling block was my SMTP settings in the webconfig.

    Should this be marked as the answer?

    Cheers,

    Stephen

  • Mike Beach 3 posts 51 karma points
    Mar 24, 2014 @ 19:48
    Mike Beach
    0

    Just to confirm adding 

    mailMessage.From = new MailAddress(senderEmail);

    to row 85 of App_Code/ContactController.cs worked for me.


Please Sign in or register to post replies

Write your reply to:

Draft