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

前端 未结 4 544
北恋
北恋 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:15

    This is how it works.

    MailMessage message;
    //prepare message
    message.Sender = new MailAddress("Sender-email-id", "Sender Name");
    new SmtpClient().Send(message); 
    

提交回复
热议问题