user3801860
user3801860

Reputation: 21

Send mail with not existing mailaccount as sender

I'm currently facing an obscure problem and I hope that someone might know an answer to this.

In the past, my company was working with Delphi 5. Email-sending was handled by a component called TNMSMTP. It's custom for these applications to use fake mail-adresses as an additional source of information. For example, if the service "ReceiveDelivery" on the server sv102 would encounter a problem, the mail adress would be ReceiveDelivery@sv102

I'm rather new here and try to convince management to make the step to .net programming. For that, I need to imitate the above behaviour by using the system.net.mail framework. However, whenever I try to use a fake mail address I receive the 5.7.1 "Client does not have permissions to send as this sender" exception. The new Program runs on the same server, under the same user and tries to access the same smtp server as the old delphi programs.

My question is: Can I somehow bypass this, or do I need to get back to Delphi for this to work?

Upvotes: 1

Views: 1198

Answers (2)

user3801860
user3801860

Reputation: 21

so we finally found the solution to this problem. It seems that the right to send mails with variable sender adresses is not bound to specific users, but to the server the application is run on.

In my case, the .net development server wasn't in that list. Now that we added it, I can use this functionality.

Thank you guys!

Upvotes: 0

Michael Petito
Michael Petito

Reputation: 13161

The error you're receiving is from your smtp server, which indicates that you're not authenticating with the server in the same way as before.

Are you sure you've correctly configured the smtp client? You can do so using the smtp configuration element in your .config file or at runtime programmatically.

Also, you could try using the fully qualified domain name (FQDN) of the server. For example the sender email address would be: [email protected]. You can get the FQDN using the following .NET code: How to find FQDN of local machine in C#/.NET ?.

Upvotes: 4

Related Questions