using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Net; using System.Net.Mail; using automatic_email.Models; using Comfirm.AlphaMail; namespace automatic_email.Controllers { public class emailController : Controller { // GET: email public ActionResult Page_load() { //MailMessage mailMessage = new System.Net.Mail.MailMessage(); //mailMessage.To.Add("my email"); //mailMessage.CC.Add("someone email"); //mailMessage.Subject = "Some subject"; //mailMessage.Body = "Some text"; //using (var smtpClient = new SmtpClient()) //{ // smtpClient.Send(mailMessage); //} GMailer.GmailUsername = "my email"; GMailer.GmailPassword = "my password"; GMailer mailer = new GMailer(); mailer.ToEmail = "my email"; mailer.Subject = "Verify your email id"; mailer.Body = "Thanks for Registering your account.<br> please verify your email id by clicking the link <br> <a href='youraccount.com/verifycode=12323232'>verify</a>"; mailer.IsHtml = true; try { mailer.Send(); } catch (Exception ex) { ViewBag.data = ex.ToString(); } return View(); } } }
Page_Load(object sender, EventArgs e)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)