Questions tagged [system.net.mail]

System.Net.Mail is a namespace of the .NET framework. It contains classes used to send electronic mail to a Simple Mail Transfer Protocol (SMTP) server for delivery.

System.Net.Mail is a namespace of the .NET framework. It contains classes used to send electronic mail to a Simple Mail Transfer Protocol (SMTP) server for delivery.

References

290 questions
3
votes
5 answers

Send mail in asp.net

I am using asp.net 3.5 and C#. I want to send mail from asp.net, for that I have got some details from my hosting provider which are these: mail.MySite.net UserName Password But I am unable to send mail through these details, I have done the…
Zerotoinfinity
  • 6,290
  • 32
  • 130
  • 206
3
votes
3 answers

Relay access denied, system.net.mail

We have a aspx.net site which send out mail to users using a web server hosted externly. This have been working perfectly for a couple of years sending 100-1000 mails pr day, but recently users have started to report that they do not recieve mails -…
Muleskinner
  • 14,150
  • 19
  • 58
  • 79
3
votes
1 answer

How to send emails with a Return Path in .net 3.5

Can any one guide me on how i can send emails with a return path in ASP.net 3.5 / C# 3.5. I know this was possible few years back but now due to spoofing issues this is not possible. I have been looking on internet but no use. I want the emails if…
Haroon
  • 31
  • 2
3
votes
1 answer

Correct Syntax for Generating HTML Email using AlternateView

I'm trying to use the AlternateView to cater for both HTML and Text clients. I would prefer to use HTML and only fall back to text where necessary. I started re-coding an old console app to do this but I still have carriage returns and newlines as…
IrishChieftain
  • 15,108
  • 7
  • 50
  • 91
3
votes
0 answers

How to detect user email address when user clicks on a link sent to their email?

I am sending links to user email using System.Net.Mail in MVC which redirect user to a page in my app when they click on it. For security reason, I need to prevent users from sharing that sensitive link. So I encrypt the url parameters before…
Amir Chatrbahr
  • 2,260
  • 21
  • 31
3
votes
0 answers

Missing new line in MailMessage sent by System.Net.Mail.SmtpClient

I'm using System.Net.Mail.SmtpClient to send a MailMessage. It is a simple text message and mostly working fine. An example SMTP message is shown below. Notice the line: =0D=0ACall reason: Intermittent Internet connection=0D=0AApplicat= I expect…
Michael Levy
  • 13,097
  • 15
  • 66
  • 100
3
votes
1 answer

Why doesn't the Bcc message header on an email work when using SmtpDeliveryMethod.SpecifiedPickupDirectory?

We have an email job that uses System.Net.Mail Emails get sent to a folder, and a job runs to copy the files to the Pickup folder on our Exchange server at a specified time of day. A copy of the email gets sent to an internal mailbox by using the…
Rachel
  • 130,264
  • 66
  • 304
  • 490
3
votes
1 answer

Edit HTML Email template at run time in .net code

I below code is to send email by reading the template html, and it works fine. But now my question is how to pass Salutation customerName from my .net code to the template at run time. StringBuilder strBlr = new StringBuilder(); string…
Pradeep
  • 2,639
  • 11
  • 36
  • 45
3
votes
1 answer

Can't send email with plus symbol (SmtpClient.Send() method from System.Net.Mail)

Can the SmtpClient.Send() method from System.Net.Mail really not send to email addresses that have plus symbols in them? I am sending to a list of email addresses and they all get sent except the ones that contain a plus (+) symbol. Any ideas or…
Brian David Berman
  • 7,514
  • 26
  • 77
  • 144
2
votes
1 answer

sending big attachments using C# ASP.NET 3.5 System.Net.Mail

I have been trying to send a big attachment (9 MB) using C# ASP.NET 3.5 System.Net.Mail. I read that .NET 4.0 had a bug which doesn't allow this, but .NET 3.5 is fine. .NET 4.0 Fails When sending emails with attachments larger than 3MB Since .NET…
engg
  • 343
  • 1
  • 4
  • 12
2
votes
1 answer

How do you digitally sign a System.Net.Mail.MailMessage?

One of the requirements of the project I am working at involves digitally signing e-mail messages. I can, of course, build the messages and send them through a SMTPClient, but I really can't figure out how to digitally sign them. I have some .pfx…
DotNetStudent
  • 889
  • 9
  • 24
2
votes
4 answers

Closing file attached to email System.Net.Mail

I have a file I attach to email in an ASP.NET application. The problem is that the process will not let go of the file. How do I close the file in the method so I can use it in my program again? Attachment data = new…
Joe Tyman
  • 1,417
  • 5
  • 28
  • 57
2
votes
3 answers

Programmatically Verify an email message reached an exchange mail box

I have a job that runs which sends out emails to our users to which starts off a work flow process in our company. Periodically, a user will swear up and down that they didn't receive the email - though, when we go to the mail administrator to pull…
Dave Harding
  • 1,280
  • 2
  • 16
  • 31
2
votes
3 answers

SMTP Exception when trying to send mail in C#

I am using the following very simple code and I keep getting System.Net.Mail.SmtpException failure sending mail. This is my code: static void main(string[] args) { MailAddress from = new MailAddress("MyEmail@gmail.com", "Mr. Test"); …
Daniel
  • 6,595
  • 9
  • 38
  • 70
2
votes
1 answer

VB SMTP through System.Net.Mail stopped working

I have a VB.NET application that sends emails to users letting them know something requires their attention. The mail is generated within the app and sent through a Microsoft 365 Account. This has worked for years without an issue, however 2 days…
JPC
  • 33
  • 4