I'm trying to develop an app that sends email, and our internal network is locked down pretty tight, so I can't relay using our internal mail servers.
Has anyone ever used something like no-ip.com? Are there any other alternatives?
I'm trying to develop an app that sends email, and our internal network is locked down pretty tight, so I can't relay using our internal mail servers.
Has anyone ever used something like no-ip.com? Are there any other alternatives?
The usual answer is to run SMTP locally under IIS, but you need to be careful about who you're sending to. It might actually be better to send to your usual SMTP server and target only accounts within your domain.
I would agree with the above...setup your own test SMTP server, and use that for your testing.
Here's some info to get you on the right track:
http://service1.symantec.com/support/ent-gate.nsf/docid/2007241920754398
You can save the email to disk:
#if DEBUG
smtpClient.PickupDirectoryLocation = "\\Path\\to\\save\\folder";
smtpClient.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
smtpClient.Send(msg);
#endif
If you just need to check that the e-mails are being sent to the correct addresses and with the correct contents, the easiest way is to use a drop folder by editing the app or web.config file:
<system.net>
<mailSettings>
<smtp deliveryMethod="SpecifiedPickupDirectory" from="[email protected]">
<specifiedPickupDirectory pickupDirectoryLocation="C:\TestMailDrop"/>
</smtp>
</mailSettings>
</system.net>
This will result in the e-mails being created as files in the specified directory. You can even then load the files and verify them as part of a unit test.
(As codekaizen points out, this can also be done in code if you don't mind modifying the code/hardcoding the drop folder and having the behavior differing in debug/release mode.)