+1 vote

I have done the major part of reading emails, manipulating emails and so on.

I wanted to forward the email to another address.

That works fine for Gmail but when I try to deploy it to my server it is giving me 5.5.4 Invalid Address error. Do you have any idea, how can I correct it?

by (8.8k points)

1 Answer

0 votes
 
Best answer

This error is returned by your SMTP server. In other words, the problem is in the sender or recipient email address.

Check the sender and recipient addresses, double check the spelling, remove additional spaces.

Make sure your machine is trusted to send mail from the sender's domain. Make sure that you have the correct reverse DNS lookup set up.

Consider using IMail.Forward method when forwarding messages:

IMail email = ...
IMail forward = email.Forward().Forward("from@example.com").Create();

// Smtp code goes here

by (301k points)
...