2013-02-01 56 views
0

我從我的網站發送電子郵件,我希望在郵箱中有特殊標題,如下圖所示。當我發送電子郵件時,它顯示它是地址作爲標題。我怎樣才能顯示一個特殊的條款作爲標題從asp.net發送電子郵件。例如,我想將此:在asp.net中更改電子郵件發件人

Avestia出版,而不是[email protected]

enter image description here 我使用此代碼通過電子郵件發送:

bodyMsg.Append("<p>Dear admin,</p>" + RadioButtonList_Prefix.SelectedItem.Text + " " + name.Text + " " + lastname.Text + " has registered in submissin system as an author.<p></br></br></br>Best regards,</p><p>Avestia Publishing</p>"); 

      msg.IsBodyHtml = true; 
      msg.Body = bodyMsg.ToString(); 

      msg.BodyEncoding = System.Text.Encoding.GetEncoding("utf-8"); 
      msg.Priority = MailPriority.High; 

      // msg.ReplyTo = new MailAddress(TextBox2.Text); 
      msg.From = new MailAddress("[email protected]"); 
      msg.To.Add(new MailAddress(*****)); 
      SmtpClient mailsender = new SmtpClient(); 

      mailsender.Host = "SmtpClient.gerbera.arvixe.com"; 

      mailsender.Port = 587; 
      mailsender.EnableSsl = true; 
      mailsender.Credentials = new System.Net.NetworkCredential("[email protected]", "classaspnet"); 

      SmtpClient smtp = new SmtpClient(); 
      //Literal1.Text = "<script>alert(' ')</script>"; 
      smtp.Send(msg); 

任何機構可以幫助我嗎?

回答

1

更改此:

msg.From = new MailAddress("[email protected]"); 

要這樣:

msg.From = new MailAddress("[email protected]", "Avestia Publishing"); 
+1

這是行不通的! – Reza

+1

它適用於除雅虎以外的每個電子郵箱! – Reza

+0

這很奇怪。不知道雅虎!對之前運行的電子郵件進行某種緩存。 –

相關問題