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
6
votes
4 answers

System.Net.Mail - Trying to send a mail with attachment to gmail, works but for small attachments only

I use this class to send mails trough a gmail account: public class GmailAccount { public string Username; public string Password; public string DisplayName; public string Address { get …
Zippo
  • 15,850
  • 10
  • 60
  • 58
6
votes
1 answer

Does System.Net.Mail.SmtpClient support CRAM-MD5 authentication?

Does System.Net.Mail.SmtpClient support CRAM-MD5 authentication, and if so, do I need to do anything to enable it? MSDN appears to be silent on the matter.
Samuel Jack
  • 32,712
  • 16
  • 118
  • 155
5
votes
4 answers

How to send mail with large size attachment using System.Net.Mail to Google Apps?

I am trying to send mail with large size attachment upto (1MB,2MB). But sending mail fails.(Sending to Google Apps) as: MailItemEntry[] entries = new MailItemEntry[1]; String EmlPath = "C:\\testemail.eml"; …
Preeti
  • 1,386
  • 8
  • 57
  • 112
5
votes
1 answer

Request a Delivery Receipt and Read Receipt using System.Net.Mail

We are using System.Net.Mail namespace in our application to send emails to the users. Is there a way we can request a delivery receipt and read receipt options when sending emails using the above namespace (also without using any third party…
Sandeep
  • 51
  • 1
  • 3
5
votes
2 answers

System.Net.Mail reference does not exist

I have a problem creating application to send email. I already have one working as a Windows Forms Application and then decided to do the same from the empty project, because I need to make a background application now. I used the System.Net.Mail…
gthacoder
  • 2,213
  • 3
  • 15
  • 17
4
votes
2 answers

Cyrillic subject encoding in c# mails

I`m trying to send e-mail via c# and use the following code: public static bool SendSMTPMail(string smtphost, int smtpport, string smtplogin, string smtppassword, string from, string to, string subject, string body, bool isHtml) { try { …
JleruOHeP
  • 10,106
  • 3
  • 45
  • 71
4
votes
2 answers

How to make McAfee cool with sending mail from my workstation?

I am developing an application for a server and it must send mail occasionally for notifications to users. MailMessage mm = new MailMessage(); mm.To.Add("me@domain.net"); mm.From = new MailAddress("you@domain.net"); mm.Subject =…
Cyberherbalist
  • 12,061
  • 17
  • 83
  • 121
4
votes
2 answers

System.Net.Mail.MailAddress send to multiple emails with one parameter

I've just switched from the deprecated System.Web.Mail.MailAddress to System.Net.Mail.MailAddress, but it doesn't seem to be particularly flexible when passing in a parameter holding multiple addresses when using the new…
notAChance
  • 1,360
  • 4
  • 15
  • 47
4
votes
2 answers

PickupDirectoryFromIis, Sender property and SMTP MAIL FROM envelope

When you send an email using System.Net.Mail you can set the SMTP MAIL FROM envelope by using the MailMessage.Sender Property. If you set the smtp network deliveryMethod property to be "Network", the MAIL FROM envelope is set using the Sender…
Romhein
  • 2,126
  • 2
  • 17
  • 17
4
votes
1 answer

Get all emails in inbox .Net.Mail C#

I'm making a small program that can send emails and read emails. I can currently send emails however I'm not sure how I can access my inbox using .Net.Mail. Is there a way of doing this? My code is as fallows try { SmtpClient mySmtpClient = new…
Craig Gallagher
  • 1,613
  • 6
  • 23
  • 52
4
votes
2 answers

How to programmatically store (save) SMTP server details back to web.config

Searching StackOverflow, I found this question on how to Retrieve SMTP settings from Web.Config, but no details on how to update the SMTP back to the web.config file. I started with the following code: Configuration webConfig =…
Pretzel
  • 8,141
  • 16
  • 59
  • 84
4
votes
4 answers

Cannot use smtpclient to send mail with localhost iis site

I have an asp.net mvc app running on a local iis website that is failing to send mail using SmtpClient from System.Net.Mail. I am trying to send a mail to my hotmail address and I get a socket exception. Any idea what the problem might be? using(var…
Joe
  • 409
  • 2
  • 9
  • 19
4
votes
1 answer

System.Net.Mail timing out on send

I have some older code that works fine for sending emails, but visual studio tells me that the code is obsolete and I should change it over to Net.Mail from Web.Mail. I have rewritten most of it, but I have a few questions. Here is the original,…
Anders
  • 12,088
  • 34
  • 98
  • 146
4
votes
2 answers

When does the empty MailMessage constructor work?

We have an Asp.Net solution that's been in production for over 2 years using System.Net.Mail.MailMessage with the empty constructor: using (MailMessage _mailMessage = new MailMessage()) // Exception thrown here { _mailMessage.From = new…
reckface
  • 5,678
  • 4
  • 36
  • 62
4
votes
2 answers

E-mail with no content when using the System.Threading.ThreadPool

I'm experiencing a strange behavior trying to send email using Threading.ThreadPool. This has worked for over a year now but recently it has stated to intermittently send emails with no content. The addressees and subject are all fine, however, the…
GJKH
  • 1,715
  • 13
  • 30
1 2
3
19 20