question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What sender address when use SmtpClient?

See original GitHub issue

This is maybe a stupid question, forgive me please.

I use this started a server:

var options = new SmtpServerOptionsBuilder()
    .ServerName("localhost")
    .Port(25, 587)
    .Build();

var smtpServer = new SmtpServer.SmtpServer(options, ServiceProvider.Default);
await smtpServer.StartAsync(CancellationToken.None);

so how to set the sender address in SmtpClient?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
cosullivancommented, May 20, 2021

yes that is correct.

If you wanted to forward the message you would need to handle that yourself.

0reactions
ahdungcommented, May 20, 2021

I think I got it, it can be a message receiver, accept message in, but never process out. right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

SmtpClient Class (System.Net.Mail)
Sends the specified email message to an SMTP server for delivery. The message sender, recipients, subject, and message body are specified using String...
Read more >
c# - Using System.Net.Mail.SmtpClient, change the SMTP ...
The FROM address used in System.Net.Mail is used for both the SMTP transaction (Envelope-From) and the MailMessage from header value.
Read more >
Sending a Simple Email Using SmtpClient in C#
The MailMessage constructor take two objects of the MailAddress class as the sender address and receiver address. SmtpClient sends and receives ...
Read more >
SmtpMail.Sender Property
This property indicates the original email sender. This is what you see as the "FROM" in most mail clients. Reply-To. This property indicates...
Read more >
Forcing the from address when postfix relays over smtp
This is how to really do it in postfix. This config changes sender addresses from both local originated, and relayed SMTP mail traffic:....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found