For questions about the MailAddress class in .NET - used for emailing.
Questions tagged [mailaddress]
22 questions
0
votes
2 answers
How to exclude or remove a specific e-mail address from a sendEmail function in c#
I'm trying to remove or exclude a couple specific e-mail addresses from the CC e-mail address list. How should I do this? Here is the function:
private void SendEmail(string emailTo, string subject, string body)
{
using (SmtpClient client = new…

Marv Ellis Chris
- 1
- 2
0
votes
1 answer
Best way to validate email address format in C#
Hi I am working on a bulk email sending feature. Below is my loop that validates email and sends them to each recipient:
foreach (var userID in recipientUserIds)
{
var userInfo = //getting from database using userID.
try
{
to =…

Naphstor
- 2,356
- 7
- 35
- 53
0
votes
1 answer
I want to apply Except between two lists. One list is in MailAddress format and other is a String (Converted to list))
I want to apply Except between two lists. One list is in MailAddress format and other is a String (Converted to list))?
List toemails = new List();
//List emailsFrom =…

RUTUJ PURANIK
- 3
- 2
0
votes
1 answer
What is this constructor doing? new MailAddress[0]
I know how to use MailAddress like this:
new MailAddress("someone@foo.com")
But what is this I'm seeing:
new MailAddress[0] - how is this used and when is it ok to use? I don't see anything about this in the docs on MSDN.

JacobIRR
- 8,545
- 8
- 39
- 68
0
votes
1 answer
Net Framework 4.5 MailAddress format and consecutive dots
The Net Framework 4.5 MailAddress class supports the following mail address formats: blah, blah "Consecutive and trailing dots in user names" blah, blah. "user names" are, I believe, synonymous with "local part" yet RFC5322 et al state that…

Richard Creer
- 9
- 2
-1
votes
2 answers
Is Regex stable to use for email validation oppsed to the mailAddress Class?
I have this function of which works fine however is there and easier way to complete the validation check using the mail address class, and would it be more fitting. Thanks in advance.
TextBox tb = new TextBox();
tb.KeyDown += new…

whatdoyouNeedFromMe
- 105
- 11
-1
votes
1 answer
Why .NET MailAddress' class properties are readonly
I want to inherit from MailAddress class to make a COM visible class, but MailAddress does not have a parameterless constructor, and COM doesn't have a mechanism to pass arguments to a…

jrivam
- 1,081
- 7
- 12