一個問題關於MVC發送郵件3.發送郵件MVC 3
當我點擊btnApply
應發送2封電子郵件給[email protected]
併發送確認到(誰填補電子郵件ID的應用形式是一樣[email protected]
)
例如:
- EMAIL1:
[email protected]
- 電子郵件2:
[email protected]
- EMAIL3:電子郵件提醒服務,在申請的形式,例如
[email protected]
當EMAIL3點擊申請從EMAIL1(發件人)發送郵件到電子郵件2(接收器) & Email3(接收器)
或當EMAIL3點擊申請從電子郵件2(發件人)到發送郵件
電子郵件2(接收器) & EMAIL3(接收器)
我有形式彈出:
@using (Html.BeginForm()){ Your Full Name <input type="text" value="" id="txtname" name="txtname" required /> Your Email <input type="email" value="" id="txtemail" name="txtemail" required /> Upload Your Resume <input name="Upload Saved Replay" id="btnFile" type="file" /> <input type="button" id="btnApply" name="btnApply" value="Apply" /> }
我有ae郵件管理,它只發送1個郵件從[email protected]電子郵件所指定的申請表格([email protected])
public class EmailManager { private const string EmailFrom = "[email protected]"; public static void Enquiry(int JobId, string UserName, string Email, string Massage) { using (var client = new SmtpClient()) { using (var message = new MailMessage(EmailFrom, Email)) { message.Subject = "Successful"; message.Body = "<html><head><meta content=\"text/html; charset=utf-8\" /></head><body><p>Dear " + UserName + ", </p> <p>Thankyou for Registering</p>" + "</a></p><div>Best regards,</div><div>Nisha</div></body></html>"; message.IsBodyHtml = true; client.EnableSsl = true; client.Send(message); }; }; } }
'EmailFrom'是'某某@ gmail.com'那麼爲什麼你想將它發送到同一個'XYZ @ gmail的.com' – jamiedanq
我認爲你應該清楚你想做什麼。哪些是EmailFrom,哪些是你發送給Email的。如果您澄清知道如何發送電子郵件更容易。此外,如果你想其他'電子郵件'複製到**電子郵件**您發送明確指示它 – jamiedanq
重命名您的變量'EmailFrom'到'EmailTo'以便於理解和最佳實踐,我建議您評論您的代碼,使其更容易閱讀 – jamiedanq