2019 Holiday Exchange!
 
A New and Exciting Beginning
 
The End of an Era
  • posted a message on How to send email from my c# website using asphostportal.com mail
    I have one year web hosting with email account from asphostportal.com
    How I can i config my website feedback ,or send any mail to third person from my website.
    This is my code.

    StreamReader reader = new StreamReader(Server.MapPath("~/RegistrationEmailBody.htm"));
    string readFile = reader.ReadToEnd();
    string myString = "";
    myString = readFile;
    myString = myString.Replace("$$UserName$$", Username);
    myString = myString.Replace("$$Password$$", password );
    MailMessage Msg = new MailMessage();
    MailAddress fromMail = new MailAddress("xyz@hero.in");
    // Sender e-mail address.
    Msg.From = fromMail;
    // Recipient e-mail address.
    Msg.To.Add(new MailAddress(UserEmailId));
    // Subject of e-mail
    Msg.Subject = "OES Infotech Online Examination User Credential";
    Msg.Body = myString.ToString();
    Msg.IsBodyHtml = true;
    SmtpClient mailClient = new SmtpClient("hosting.secureserver.net", 80);
    // Change your gmail user id and password for send email
    NetworkCredential NetCrd = new NetworkCredential("xyz@hero.in", "abcd");
    mailClient.UseDefaultCredentials = false;
    mailClient.Credentials = NetCrd;
    mailClient.EnableSsl = true;
    mailClient.DeliveryMethod = SmtpDeliveryMethod.Network;
    mailClient.Send(Msg); 


    Plz Help me
    Posted in: Geeks Corner
  • To post a comment, please or register a new account.