1

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?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
user3801860
  • 21
  • 1
  • 5

2 Answers2

4

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: ReceiveDelivery@sv102.internal.company.com. You can get the FQDN using the following .NET code: How to find FQDN of local machine in C#/.NET ?.

Community
  • 1
  • 1
Michael Petito
  • 12,891
  • 4
  • 40
  • 54
  • You mentioned that the program runs "under the same user". Is your .NET code using network credentials (e.g. a configured username and password) to authenticate with the SMTP server, or are you relying on some form of implicit authentication based on the current user? See the remarks regarding authentication here: http://msdn.microsoft.com/en-us/library/ms164242(v=vs.110).aspx – Michael Petito Jul 09 '14 at 15:08
0

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!

user3801860
  • 21
  • 1
  • 5