Send Email from button?

Discussion in 'Site Programming, Development and Design' started by Charlie, May 6, 2010.

  1. Hi,

    I am trying to work out how a user can email me from my site by clicking a button on a web page. I am using the code below which I got from here - http://www.systemnetmail.com/faq/3.1.1.aspx . My Winhost email is enabled and I set a timezone and now have the postmaster@ detail. Is there a Winhost specific smtp client reference that I need or do I need to adjust anything else with the settings in my Winhost email ? I would be very grateful if anyone would point me in the right direction.

    Code:
     
    using System.Net.Mail;
    
    
    protected void Button6_Click(object sender, EventArgs e)
              {
                //create the mail message
                MailMessage mail = new MailMessage();
    
                //set the addresses
                mail.From = new MailAddress("[email protected]");
                mail.To.Add("[email protected]");
    
                //set the content
                mail.Subject = "This is an email";
                mail.Body = "this is sample body text";
    
                //send the message
                SmtpClient smtp = new SmtpClient("127.0.0.1");
                smtp.Send(mail);
    
            }
     
    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray

    Last edited by a moderator: Oct 14, 2015
  3. Cheers for that Ray - all working with a new email account. Can you tell me how to find the postmasters password?
     
  4. Ray

    Ray

    If you do not remember your postmaster password you can reset it.

    Log into your Winhost control panel and click on the tab marked Sites. From there you should be able to navigate to your Site Info Manager. That is where you will see a number of different buttons and you will find the button Email. Click on that to access your email manager. You will also see a link in email manager that reads SmarterMail Manager. Click on that and it will automatically open a window and log you into smartermail's web mail interface. From there, click on Settings/Accounts and you can update or reset the password to your postmaster account.

    Remember, the link SmarterMail Manager in your control panel will only log you into the postmaster account. If you have different POP accounts you will need to manually call on them by typing your mail domain name (as an example; mail.domain.com) and log into the desired POP account. You may want to look at this kb article.

    http://support.Winhost.com/KB/a551/getting-started-with-the-smartermail-email-system.aspx
     
    Last edited by a moderator: Oct 14, 2015

Share This Page