| | |
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 activedirectory ado.net algorithm array barchart bitmap box broadcast buttons c# check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development disabled displayingopenforms draganddrop drawing encryption enum event excel exectuable file files form format forms ftp function gdi+ httpwebrequest image index index-error input install java label list listbox listener mandelbrot math mathematics mouseclick mysql operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox serialization server setup sleep socket sql statistics stream string table tcp text textbox thread time timer update user usercontrol validation visualstudio webbrowser windows winforms wpf xml






