Sending emails in asp.net with specific name instead of sender email

前端 未结 4 560
北恋
北恋 2021-02-02 10:38

I need to send an email in asp.net but I need sender appears like \"MySiteName\" without info@mysitename.com.

4条回答
  •  不思量自难忘°
    2021-02-02 11:12

    you could try something like this

    MailAddress from = new MailAddress("info@mysitename.com", "MySiteName");
    

    More info here

    http://msdn.microsoft.com/en-us/library/system.net.mail.mailaddress.aspx

提交回复
热议问题