Problem With Sending Email Through Asp.net

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Apr 2008
Posts: 13
Reputation: compovet is an unknown quantity at this point 
Solved Threads: 0
compovet compovet is offline Offline
Newbie Poster

Problem With Sending Email Through Asp.net

 
0
  #1
Nov 24th, 2008
I'm trying to sending Email through my web application from Gmail
by using Sustem.Net.Mail.SmtpClient
My code is
  1. string To = "doctor_ofvet@yahoo.com";
  2. string From = "doctorofvet@gmail.com";
  3. string Subject = "The Famous";
  4. string Body = "Hello World";
  5. SmtpClient Client = new SmtpClient();
  6. Client.Send(From, To, Subject, Body);

I put this code in the web.config file
  1. <system.net>
  2. <mailSettings>
  3. <smtp>
  4. <network host="smtp.gmail.com" port="465" userName="Gmail Username" password="Password"/>
  5. </smtp>
  6. </mailSettings>
  7. </system.net>

but it did not success
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 13
Reputation: compovet is an unknown quantity at this point 
Solved Threads: 0
compovet compovet is offline Offline
Newbie Poster

Re: Problem With Sending Email Through Asp.net

 
0
  #2
Nov 24th, 2008
can any one help me please
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 5
Reputation: EastStreetEagle is an unknown quantity at this point 
Solved Threads: 1
EastStreetEagle EastStreetEagle is offline Offline
Newbie Poster

Re: Problem With Sending Email Through Asp.net

 
0
  #3
Nov 24th, 2008
Hi there,

Last time I mailed with C#-code, it happened like this:

MailMessage mailMessage;
SmtpClient client;

mailMessage = new MailMessage();
client = new SmtpClient("relay.skynet.be"); //your mail-out server
mailMessage.To.Add("...@hotmail.com");
mailMessage.Subject = "...";
client.Send(mailMessage);

This was not in a web application but just a C#.NET windows application. I hope this helps you.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: Problem With Sending Email Through Asp.net

 
0
  #4
Nov 24th, 2008
debugging would show wether your mail settings are being picked up for your new smtpclient. If not, it maybe better to set them.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC