Click here to Skip to main content
15,902,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all :)



I'm trying to learn sinding emails from web page



but I don't know how to get host value here : smtpClient(string host);



I have a host with domain name "something.net" for example, what value should I set above ?

I tries to set the same name of my host " something.net ", but didn't work :(

here is my code

C#
protected void Button1_Click(object sender, System.EventArgs e)
    {
        try
        {
            MailMessage message = new MailMessage("something1@live.com", "something2@live.com", "hi", "hi hi hi");
            SmtpClient emailClient = new SmtpClient("I dont know what I have to put here");
            emailClient.Send(message);
            Label1.Text = "Message Sent";
        }
        catch (Exception ex)
        {
            Label1.Text = ex.ToString();
        }
    }


thank you all :)
Posted

1 solution

You put the mail servers address there like mail.domain.com

See here : http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/d2217c49-e5de-430a-9a86-fd2767743ad1[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900