[英]Need to change FromEmail String when sending Email through SMTPClient
我的電子郵件發送代碼
MailMessage msg = new MailMessage("mailer@abc.com", "xyz@hotmail.com", "testing email", "to check from email label text");
SmtpClient smpt = new SmtpClient();
smpt.Send(msg);
當xyz@hotmail.com用戶打開電子郵件時,在發件人電子郵件中,其提及的mailer@abc.com就像Abc Corporation [abc@nextech.pk]
如何更改電子郵件地址標簽
謝謝
創建具有真實姓名和電子郵件地址的MailAddress,然后將其提供給MailMessage。
從MSDN(MailMessage的From屬性 )。
MailAddress from = new MailAddress("ben@contoso.com", "Ben Miller");
MailAddress to = new MailAddress("jane@contoso.com", "Jane Clayton");
MailMessage message = new MailMessage(from, to);
使用顯示名稱
MailMessage m = new MailMessage();
m.From = new MailAddress("mail@mailserver.com", "My Mail");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.