| | |
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:
Solved Threads: 0
I'm trying to sending Email through my web application from Gmail
by using Sustem.Net.Mail.SmtpClient
My code is
I put this code in the web.config file
but it did not success
by using Sustem.Net.Mail.SmtpClient
My code is
C# Syntax (Toggle Plain Text)
string To = "doctor_ofvet@yahoo.com"; string From = "doctorofvet@gmail.com"; string Subject = "The Famous"; string Body = "Hello World"; SmtpClient Client = new SmtpClient(); Client.Send(From, To, Subject, Body);
I put this code in the web.config file
C# Syntax (Toggle Plain Text)
<system.net> <mailSettings> <smtp> <network host="smtp.gmail.com" port="465" userName="Gmail Username" password="Password"/> </smtp> </mailSettings> </system.net>
but it did not success
•
•
Join Date: Nov 2008
Posts: 5
Reputation:
Solved Threads: 1
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.
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.
![]() |
Similar Threads
- Cannot find server or DNS Error - please help! (Viruses, Spyware and other Nasties)
- Email Sending Problem in ASP.NET (ASP.NET)
- problem in sending mail form web application (ASP.NET)
- Strange problem in sending emails by asp.net (ASP.NET)
Other Threads in the C# Forum
- Previous Thread: inequality method in C#
- Next Thread: Temperature conversion class in C#
| Thread Tools | Search this Thread |
.net access algorithm array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom cyclethruopenforms data database datagrid datagridview dataset date/time datetime degrees development draganddrop drawing encryption enum excel file filename finalyearproject form format forms function gdi+ getoutlookcontactusinfcsvfile gis globalization gtk httpwebrequest image index input install installer java label list listbox mandelbrot math mono mouseclick mysql operator panel path photoshop picturebox pixelinversion post programming radians regex remoting richtextbox save server silverlight sleep socket sql sql-server statistics stream string table text textbox thread time timer timespan update usercontrol users validate validation visualstudio webbrowser wia windows winforms wpf xml






