create mail server

Discussion in 'Email' started by karwan, Mar 9, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. hello
    i had a domain and some days a go i register a hosting from discount. it's really perfect.
    NOW
    i write a program (asp.net) that run in my iis (local) but i want to send mails from may mail address that i define in my hosting ([email protected]).
    it means i have a form and lod some sender's address from may DB and i want to send them mails.
    it's my config code
    Code:
    	<mailSettings>
                <smtp from="[email protected]">
                    <network host="smtp.elmosanat.co.ir" userName="" password="" />
                </smtp>
    		</mailSettings>
    
    
    and my sendmail.aspx code

    Code:
    MailMessage mailMessage = new MailMessage();
            mailMessage.From = new MailAddress("[email protected]");
            mailMessage.To.Add("****@yahoo.com");
            mailMessage.Subject = Subject;
            mailMessage.Body = body;
            mailMessage.BodyEncoding = System.Text.Encoding.UTF8;
            SmtpClient smtp = new SmtpClient("Localhost"); 
            smtp.Send(mailMessage);
    
    i know that if i load my program on my hosting mail my be send but i want to load it in my computer just use my domain SMTP server.
    please guide me.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    If you send from remotely (outside of the web server), you'll have to switch your SMTP server to mail.yourdomain.com and use proper SMTP authentication.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page