The problem is that this code works on my local machine when I use my smtp server but when I put it on someone else's machine, it doesn't work. I get various error messages depending on smptServer and on the delivery method.
For example, if I have no delivery method, and I run this on my local machine but using the other person's smtp server, then I get the message:
"Service not available, closing transmission channel. The server response was: 4.3.2 Service not available, closing transmission channel"
If I include the line client.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis right before I send, I get:
"Cannot get IIS pickup directory."
If I replace that line with SmtpDeliveryMethod.SpecifiedPickupDirectory, I get:
"Only absolute directories are allowed for pickup directory."
If I replace that line with SmtpDeliveryMethod.Network, I get the "service not available" message again.
This is all if I run it on my local machine using the other person's smtp server. I haven't been able to test it on their machine with anything other than my own smtp server, but I know that none of the delivery methods work on their machine either. I have yet to try it on their machine with their smtp server with or without delivery methods (this will have to wait until they get back after the weekend).
Can anyone see the problem? Do you think it's just a matter of using their smtp server on their machine (without a delivery method)?