本文介绍了在具体的名称,而不是发件人电子邮件asp.net发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在asp.net中发送一封电子邮件,但我需要发件人出现像MySiteName无[email protected]需要在asp.net中发送一封电子邮件,但我需要发件人出现像MySiteName没有信息@ mysitename .COM

I need to send an email in asp.net but I need sender appears like "MySiteName" without [email protected] need to send an email in asp.net but I need sender appears like "MySiteName" without [email protected]

推荐答案

这样的:

using(MailMessage message = new MailMesage(
        new MailAddress("[email protected]", "Your Name"),
        new MailAddress("[email protected]", "Their Name")
    )) {
    message.Subject = ...;
    message.Body = ...;

    new SmtpClient().Send(message);
}

您需要在Web.config中输入的 SmtpClient 连接设置

You will need to enter the SmtpClient's connection settings in Web.config

这篇关于在具体的名称,而不是发件人电子邮件asp.net发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 07:07