Send Mail Task

  • Hi,

    I am using a Send mail Task in my application, when opening the Send mail Task Editor, it is required to enter various details. At our company we have to enter the Server Name instead of an email address in  the "From" option. SQL 2000 allows u to enter the server name in the from clause but in SQL 2005 in complains that there should be an @ clause in the statement.

    Does anybody know anything about the Send Mail Task data item, and is there any other way I can include the server name?

    Regards

    Imke

  • You could always use ServerName@domainname.com in the FromLine of the Send Mail Task (so long as your SMTP server accepts this as a valid address). You can acomplish this by building an expression; i.e. @[System::MachineName] + "@mydomain.com"

  • Hi Tommy,

    Thanks, I did what u suggested and no error pops up. However the mail is not sent to the destination address.

    Here is a list of all the items that I included onto the Send Mail Editor.

    SMTPConnection: SMTP Connection Manager

    From: Servername@domainname.co.za

    To: Destination address

    CC: Destination address

    Subject: [Subject]

    MessageSource: ?

    What exactly is the message source and what should I put in the option. Should it be the exended stored  proc and how should it be structured?

    Your help would be much appreciated.

    Kind regards

    Imke

  • Are you trying to enter your server name as opposed to creating a Mail connection object?  Or are you just needing the server name as the "FROM" part?

    If the later, what we did was set up DBMail on SQL Server with the fake email address of <A href="mailtoROD_MyServer@MyCompany.Com">PROD_MyServer@MyCompany.Com.  It works, though no replies to that address will ever go anywhere.  Then we just use the above address in the FROM part of the SendMail task.  We have one for QC, Test and Dev also.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Hi Imke,

    Your message source can be anything you want; you can build an expression using variables, etc. i.e.

    "THE FOLLOWING FILE HAS BEEN TRASMITTED TO SOMEHOST VIA FTP." + "\n" + "\n" + "FILENAME:" + @[User::varFileName] + "\n" + "RECORD COUNT: " + (dt_wstr,9)@[varRowCount] + "\n" + "\n" + "*** THIS IS AN AUTO-GENERATED MESSAGE ***"

    Might be worthwhile to send your message via telnet first - just to make sure you can communicate/authenticate (if applicable) to your smtp relay. An example of how to do this is available here (http://www.wowarea.com/english/help/smtptel.htm)

    If you can send mail succesfully via telnet; check your SMTP connection manager and make sure the FQDN of the host is accurate and check windows authentication (if your SMTP relay is MS exchange or IIS SMTP virtual server, etc. it might require NTLM). 

    I typically create proxy accounts and use the proxy accounts to execute my SSIS packages via DTSEXEC. This helps if your in an environment where you need to authenticate to an SMTP relay, ISA firewall, etc.

    Hope this helps.

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

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