2017-02-21 4 views
2

私が送信される電子メールは、HTMLを生成していないEメールを生成していないウェブサイトからのメール?

//create the mail message 
MailMessage mail = new MailMessage(); 
//set the FROM address 
mail.From = new MailAddress(from); 
//set the RECIPIENTS 
mail.To.Add(to); 
//enter a SUBJECT 
mail.Subject = subject; 
//Enter the message BODY 
mail.Body = body; 
//set the mail server (default should be smtp.1and1.com) 
SmtpClient smtp = new SmtpClient("smtp.1and1.com"); 
//Enter your full e-mail address and password 
smtp.Credentials = new NetworkCredential("[email protected]", "Password"); 
//send the message 
smtp.Send(mail); 

(ここhttps://help.1and1.com/hosting-c37630/scripts-and-programming-languages-c85099/aspnet-c39624/send-an-e-mail-using-aspnet-a604246.htmlからの引用)私のウェブサイトからの電子メールを送信するには、このコードを使用しています。リンクを表示する代わりに、リンクの実際のコードが表示されます。

私は間違っていますか?あなたは次の行を追加する必要が

+0

あなたのご意見を私があなただったら....私は実際のコードのものが含まれません。行が自明であれば、コメントする必要はありません。あなたは基本的にコードがすでに言っていることを再ハッシュしています。ラインが不明瞭で予期しない場合にのみ私はそれをコメントしたいと思います。 – mason

答えて

4

:すべての行に

mail.IsBodyHtml = true; 
+0

ありがとう!できます! –

関連する問題