Click here to Skip to main content
15,903,203 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,
This is the code where im trying to send mail. Since one n half month im trying to send mail, but its giving very much trobule. Few told have to configure in web.config file. I dint know anything, but some how i made changes.

XML
<system.net>
        <mailSettings>
            <smtp>
                <network host="localhost" port="25"/>
            </smtp>
        </mailSettings>
    </system.net>


Tell me if any one knows why v have to make changes in config file,

Some one told have to configure smtp... but im not sending from local server. My website already hosted...

my website url is www.karthavyaebusiness.com

Message.From = new MailAddress("http://mail.karthavyaebusiness.com");
Message.To.Add(new MailAddress("kriish05@yahoo.com"));
Message.Subject = "Enquiery About Product";
Message.Body = "Testing Message";
SmtpClient client = new SmtpClient("127.0.0.1");
client.Send(Message);

Pls help me any one, Im stranges to .net.
Advance thnks to all...
Posted
Comments
Henry Minute 23-Nov-10 8:55am    
You have accepted the answer below as an answer, this automatically marks your question as solved. This doesn't mean that you will get no more answers, but it does cut down the chances. I would suggest that you change your acceptance. :)

What error is prompting by complier ?
 
Share this answer
 
Comments
Kriish05 23-Nov-10 8:57am    
Error Msg : The specified string is not in the form required for an e-mail address.
The problem is in the line

Message.From = new MailAddress("http://mail.karthavyaebusiness.com");


as http://mail.karthavyaebusiness.com is not a valid e-mail address.
 
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