MailMessage sent string as body without newline in outlook

前端 未结 10 841
挽巷
挽巷 2020-12-11 15:44

HI, I am trying to send a simple notification using system.net.mail.mailmessage. I just pass the string as the message body. But problem is even though multi-line message be

10条回答
  •  执念已碎
    2020-12-11 16:25

    This worked for me

    mMailMessage.IsBodyHtml = true;
    Literal1.Text = "Dear Admin, 
    You have recieved an enquiry onyour Website. Following are the details of enquiry:

    Name: " + TextBox2.Text + "
    Address: " + TextBox3.Text + ", " + TextBox4.Text + "
    Phone: " + TextBox5.Text + "
    Email: " + TextBox2.Text + "
    Query: " + TextBox6.Text+"
    Regards,
    Veritas Team"; mMailMessage.Body = Literal1.Text;

提交回复
热议问题