views:

492

answers:

4

I am using the Send Mail Task in SSIS 2008 to send out an email.

I am using SMTP. I have SMTP set up in the IIS manager.

I have set it to use windows authentication.

The From and To mail address both exist.

When i configure the task to send an email, i get an error

"[Send Mail Task] Error: An error occurred with the following error message: "Failure sending mail.
System.Net.WebException: Unable to connect to the remote server System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:25"

What IIS or SSIS config change has to be made for this to work?

A: 

Take a look C# Help - Sending Email With C# Using SMTP Servers, it's very nice to learn and very explained. ;)

Nathan Campos
A: 

you need to have a valid SMTp server. The error message said you can not use local machine as SMTP server. you can try use gmail.com as a relay server.

Henry Gao
+2  A: 

Check your firewall and/or virus scanner; port 25 (the default SMTP port) is often blocked by this type of software. Not sure about the SSIS Send Mail Task specifically, but SQL Server SMTP Mail service can be configured to use a different port.

If you're in a corporate environment, it's likely that your network guys have some sort of SMTP relay you could/should use instead of the local host, and they might also have some sort of IP and/or email address whitelist they need to include you on in order to relay SMTP mail.

Matt
Thanks Matt !!!, very thoughtful. Will check this out
Nick
And try using your local smtp server from some other mail client too to confirm that this is not an SSIS issue.
Faiz
A: 

Don't use the loopback IP address: try localhost or actual machine name etc

Edit: found a reference to say that 127.0.0.1 needs added to allowed IP addresses. Now, can't say if this applies to your case, but I'm sure I read something years ago about this

gbn