Default SMTP server for all SendMail Task

  • How whould I go about:

    1. Creating a system variable storing the SMTP server details

    2. How would I call this during my SendMail Task.

    I.e. i want all my send mail tasks to use the same SMTP server.

    And If the SMTP server changes I would only need to change this in one location.

  • Hi,

    1. Create a SMTP Connection Manager eg. "StandardMail"

    2. Create an environment variable (on the server where the packages are running) with the name eg. "StandardSMTP" and the value

    3. Go to your SSIS-Package and in the menu click SSIS -> SSIS Configuration

    4. Enable Package configuration

    5. Choose environment variable -> choose your variable

    6. on the next page go to the smtp connection manager and select the property "SMTPServer"

    If you use this configuration for all of your packages and the smtp server is changing then you only need to change the servername in your environment variable.

    I hope this helps 🙂

  • Ok I have set the system variable and package configuration.

    Now how do I call this variable in my SendMail Task?

  • Hi you do not have to "call" this variable in your send mail task. Your send mail task is connected with the configured smtp connection manager.

    When you've made steps 3 to 6, then close and re-open your package you'll see, that the smtp connection manager has the server specified in your environment variable. So the value will be set a) when you open the package b) when you run the package.

    If it's not clear now i could make some screenshots and post them here...

  • Thanks I understand what you mean.

    But I have 7 SSIS packages, how can I make them all use this Variable?

  • Hi,

    you must configure all of your packages with these steps to use the variable for all of them.

    Regards.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply