Questions tagged [mailaddress]

For questions about the MailAddress class in .NET - used for emailing.

22 questions
17
votes
14 answers

How to parse formatted email address into display name and email address?

Given the email address: "Jim" If I try to pass this to MailAddress I get the exception: The specified string is not in the form required for an e-mail address. How do I parse this address into a display name (Jim) and email…
Dylan
  • 2,392
  • 6
  • 26
  • 34
9
votes
2 answers

Address Standardization/Correction/Geocoding

My place of employment is looking into buying a third party tool, for batch based US and Canadian Address correction, with Geo-coding. What Products have you used? What do you like about them? What do you not like about them? Note that, We are a…
EvilTeach
  • 28,120
  • 21
  • 85
  • 141
6
votes
6 answers

Why does MailAddress think 'john@gmail.' is a valid email address?

Like a good C# user, I use the MailAddress object to validate email addresses. A client of mine entered john@gmail. for his email, which was validated by MailAddress, and broke my software. I'd expect the code below to throw an exception, but it…
Vinzz
  • 3,968
  • 6
  • 36
  • 51
6
votes
3 answers

MailAddress: An invalid character was found in the mail header

I am using MailAddress to create a fax email. We are using system called SatisFAXtion v 8.6. To provide a cover page for faxing I can add a template location to the mail.TO address. The format looks like…
Boguslaw Buczek
  • 93
  • 1
  • 1
  • 6
2
votes
1 answer

Read e-mail addresses from appsettings.json and write in a List

Unfortunately, I can't manage to load the email addresses in the appsettings.json to the list . What am I doing wrong? IConfiguration config = new ConfigurationBuilder() .AddJsonFile("appsettings.json", false, true) …
ThoDan
  • 43
  • 4
2
votes
2 answers

Should I use System.Net.Mail.MailAddress in my domain model, or just strings?

As covered well in this question, System.Uri is a good choice to reflect my intention for URIs. But what about for email addresses? It seems not as clear-cut, because MailAddress has extra information in its DisplayName property that is not a great…
Domenic
  • 110,262
  • 41
  • 219
  • 271
2
votes
1 answer

Apostrophe in email address causes SmtpException

Our business application serves many organisations and some of those have apostrophes in their email address (local part) which is technically valid. However, I cannot send out emails if the FROM or TO email address contains an apostrophe in them…
Chris Walsh
  • 3,423
  • 2
  • 42
  • 62
2
votes
3 answers

cc (mail) after say 6th email

I am trying to send multiple emails (>10) using Mailaddress class but apparently, it's not liking it. is there a way to attach emails after the 6th to CC? or any other work around? I have: (; ; ,…
QANew
  • 52
  • 8
1
vote
3 answers

MailAddress in .NET

I'm attempting to send an email and instead of sending 5 individual emails to each person, I would like to send one mass email to all 5 people. The difference here is that I want everyone to show up in the "TO" or "CC" lines. How can I do this?
Joe Phillips
  • 49,743
  • 32
  • 103
  • 159
1
vote
1 answer

MailAddress to right Fax server is not working right

I am trying to send email address and right fax service email gateway recive it just like that It gives the error here Tried to remove System.Text.Encoding.ASCII But still same issue below that is received from right fax TO :-…
bavs
  • 25
  • 7
1
vote
1 answer

C# Send email using Office 365 SMTP doesn't change given email display name

I am using C# MailMessage for sending Email through office 365, and I want to change the display name of the sender in the email. I have tried using mailMessage MailAddress Constructor like this mailMessage.From = new MailAddress("email","display…
1
vote
1 answer

new MailAddress() Exits out of method

I have a fairly weird issue that I can't wrap my head around. So here is the code: [HttpGet] [AllowAnonymous] public ActionResult SendEmail() { SendRegisterEmail("Test", "Testagain", "lastTest"); return View("Index"); } public async…
Bagzli
  • 6,254
  • 17
  • 80
  • 163
1
vote
0 answers

Change sender name doesn't work

First of all, I search for an hour how to solve my problem on other posts but the other solutions don't work in my case. My problem I need to send a report mail after the execution of my program. To send mails I use System.Net.Mail namespace and…
Thomas Rollet
  • 1,573
  • 4
  • 19
  • 33
1
vote
2 answers

ASP.NET emailing to multiple emails

I have this code here... MailAddress from = new MailAddress("noreply@fakeemail.com", "IPC Orders"); MailAddress to = new MailAddress("email1@fakeemail.com.com"); MailMessage mail = new MailMessage(from, to); …
user979331
  • 11,039
  • 73
  • 223
  • 418
0
votes
1 answer

Can I use 'Trigger Email ' extension of Firebase without a "from" email address?

I have a domain, but I don't have Email address yet. I want to use 'Trigger Email' of Firebase for my domain only, is that possible? There is an item called 'Default FROM address' in the setting of 'Trigger Email', I think that an email address is…
ggg
  • 3
  • 3
1
2