on .NET Framework , allows applications to send e-mail by using the Simple Mail Transfer Protocol (SMTP)
Questions tagged [smtpclient]
1275 questions
8
votes
5 answers
File appears to be held open after being sent as an attachment by SmtpClient. How can I delete the file?
I have a number of files that are generated in a function defined as:
Public Function GeneratePDF(exportFileName As String) As String
Dim GeneratePath As String = FileSystem.CombinePath(standardDirectory, exportFileName &…

Frosty840
- 7,965
- 12
- 50
- 86
8
votes
3 answers
Two ways to send email via SmtpClient asynchronously, different results
Simple concept here. This is for a site being built using MVC 3 and Entity Framework 4. After a user registers on the site, an email is sent to their email address. I first implemented this using SmtpClient.Send() and it worked fine. Then I got the…

John L
- 305
- 2
- 3
- 15
8
votes
4 answers
Sending mail through http proxy
I'm trying to send emails from a system that connects to internet through a http proxy which is set in Internet Options.
i'm using SmtpClient.
Is there any way to send mails with SmtpClient through this proxy setting.
Thanks

Salar
- 495
- 3
- 6
- 14
8
votes
0 answers
SmtpClient.send(MailMessage) is adding an extra period in the body text of the email
I'm using System.Net.Mail.SmtpClient.
I build my MailMessage. IsBodyHtml is set to true. The Body is some html with some links.
Occasionally, some strange behavior occurs - an extra period will get added to one of the links.
for example, the link…

John-Luke Laue
- 3,736
- 3
- 32
- 60
8
votes
1 answer
Does System.Net.Mail.SmtpClient use SSL, TLS, StartTLS, or a combination?
This question has answers about negotiating the best version of TLS/SSL available with the server: Which versions of SSL/TLS does System.Net.WebRequest support?
However I thought SmtpClient used regular Smtp for transport, with TLS on top - which as…

Mr. Boy
- 60,845
- 93
- 320
- 589
8
votes
3 answers
SMTPClient Failure During Send Concerning Arguments
I am trying to setup an email PowerShell script that will let me send an email when the task scheduler runs the script. The problem i am getting is:
Exception calling "Send" with "1" argument(s): "The remote certificate is invalid according to the…

Josh
- 345
- 2
- 3
- 10
8
votes
5 answers
Sending out 20,000+ emails with asp.net
I am writing an application that will need to send a massive amount of emails to our students who will be selected from our database (each email will be personalized to the extent that will include their name, course of study etc...so needs to be…

Kyle
- 10,839
- 17
- 53
- 63
8
votes
8 answers
Troubleshooting "The server committed a protocol violation" when sending mail with SmtpClient
I want to send a mail message with the SmtpClient class.
Here's the code I use:
SmtpClient smtpClient = new SmtpClient("Host",25);
NetworkCredential basicCredential =
new NetworkCredential("UserName", "Password");
MailMessage message = new…

Mina Wissa
- 10,923
- 13
- 90
- 158
8
votes
4 answers
MVC Contact Form with Email
I wonder if someone can please help with a MVC Contact Form which send an Email on submission? I think I have most elements setup, but for some reason the form appear to be sending (takes ages) then just returns back to the form and no email is…

iggyweb
- 2,373
- 12
- 47
- 77
8
votes
1 answer
An asynchronous module or handler completed while an asynchronous operation was still pending
I had the following for emailing, which worked:
private SmtpClient _client = new SmtpClient("smtp.gmail.com", 587)
{
Credentials = new NetworkCredential("address@gmail.com", "password"),
EnableSsl = true
};
public…

RobVious
- 12,685
- 25
- 99
- 181
8
votes
2 answers
Error in Sending Email via a SMTP Client
This may be very trivial for you but i just couldn't figure out why am i getting this error message when i run my code. I looked some of the relative questions on this same website for eg Sending email through Gmail SMTP server with C#
but none of…

Sike12
- 1,232
- 6
- 28
- 53
8
votes
1 answer
SmtpClient.SendAsync - How to stop the application exiting before the callback is triggered?
I need to send emails asychronously through a console application. I need to do some DB updates on the callback but my application is exiting before the callback code gets run!
How can I stop this from happening in a nice manner rather than simply…

James
- 80,725
- 18
- 167
- 237
8
votes
3 answers
Images breaking when sending mail using SmtpClient
I am sending a mail using C# using the SmtpClient class. I am doing the following things before sending the mail.
var mailMessage = new MailMessage();
model.ToAddresses.ForEach(to => mailMessage.To.Add(to));
mailMessage.Subject = "Test Email - By…

Yasser Shaikh
- 46,934
- 46
- 204
- 281
7
votes
2 answers
How to resolve Unable to read data from the transport connection: net_io_connectionclosed error while sending email using SMTPClient
We have an email accounts as emailName@companyDomain.in and this is configured in Office365. We want to send an email using emailName@companyDomain.in from C#.
Below code sometimes work and sometimes not (most of the times not working). Giving Error…

Oxygen
- 831
- 4
- 17
- 42
7
votes
1 answer
What is the google smtp service similar to amazon ses, is it gmail smtp?
What is the google smtp service similar to amazon ses, is it gmail smtp? I have used amazon ses smtp for sending marketing emails, by configuring in my server. So google has similar service, or is it same as smtp.gmail.com?

SmartestVEGA
- 8,415
- 26
- 86
- 139