Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify LocalEndPoint/IP Address for where to send email from #370

Open
Gaz83 opened this issue May 3, 2023 · 1 comment
Open

Specify LocalEndPoint/IP Address for where to send email from #370

Gaz83 opened this issue May 3, 2023 · 1 comment

Comments

@Gaz83
Copy link

Gaz83 commented May 3, 2023

Is there a way to specify the IP address of where to send emails from?

My host is moaning because the server I send from has multiple IP addresses and it triggers the Anti-Abuse system when sending large volumes of emails.

I am using MailKitSender and I believe this supports localendpoint configuration.

@Gaz83
Copy link
Author

Gaz83 commented May 5, 2023

Made some changes in a local project to test but this is my suggested changes.

In SmtpClientOptions add an extra property .

public IPEndPoint LocalEndPoint { get; set; }

Then in the class MailKitSender, in both Send and SendAsync where you create the SmtpClient add this

if (_smtpClientOptions.LocalEndPoint != null) { client.LocalEndPoint = _smtpClientOptions.LocalEndPoint; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant