BPC 75 send mail 2008 task

Hi Guru,
I need to develop the send mail 2008  SSIS task on SQL server 2008.
Do you have some information about it? which parameter I need to set as minimum?
Regards
Marco

Hi Marco,
you asked about the send mail 2008 SSIS task, in this task you must set "appset" and "server\userid" that send the email plus the "TO", "Message".
"Subject" "Attachments" etc. are optional.
Of course before you must set all the smtp parameter to the "Appset parameters" i.e. SMTPAUTH,  SMTPPASSWORD, SMTPPORT, SMTPSERVER and SMTPUSER.
Kind regards
Roberto
Edited by: Roberto Vidotti on Dec 14, 2011 9:47 AM

Similar Messages

  • Problem in sending mail for a pop3 account using transport.send(msg)

    hi,
    i am having problem in not able to send mail for a pop3 account ...
    I have written an email gateway which listens to my pop3 account...on email arrival it listens nd extract the contents and send it as an sms msg...upon failure it needs to deliver the mail to sender id.I am using quartz to listen.
    i am using jboss for server and java mail api.
    here is my code
    MimeMessage mimemsg = new MimeMessage(session);
                                                           mimemsg.setFrom();
                                                           mimemsg.setRecipients(Message.RecipientType.TO, to);
                                                           mimemsg.setSubject(subject);
                                                           mimemsg.setText(parsedText);
                                                           mimemsg.setSentDate(new Date());
                                                           mimemsg.setContent(strBuff.toString(), "text/html");
                                                           System.out
                                                                                    .println("Before sending mail");
                                                           Transport.send(m);
                                                                System.out.println("message sent successfully");
    excepition i am getting is :
    2008-09-12 11:45:11,140 INFO [STDOUT] Before sending mail
    2008-09-12 11:45:11,140 ERROR [STDERR] javax.mail.IllegalWriteException: POP3 messages are read-only
    2008-09-12 11:45:11,140 ERROR [STDERR]      at com.sun.mail.pop3.POP3Message.saveChanges(POP3Message.java:438)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at javax.mail.Transport.send(Transport.java:97)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at com.openstream.emailgateway.sources.ListenEmailGateway.execute(ListenEmailGateway.java:422)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:585)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:495)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:116)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:402)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.ejb.Container.invoke(Container.java:960)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at sun.reflect.GeneratedMethodAccessor88.invoke(Unknown Source)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:585)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    2008-09-12 11:45:11,140 ERROR [STDERR]      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.ejb.plugins.inflow.MessageEndpointInterceptor.delivery(MessageEndpointInterceptor.java:263)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.ejb.plugins.inflow.MessageEndpointInterceptor.invoke(MessageEndpointInterceptor.java:140)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at $Proxy73.execute(Unknown Source)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.jboss.resource.adapter.quartz.inflow.QuartzJob.execute(QuartzJob.java:57)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
    2008-09-12 11:45:11,171 ERROR [STDERR]      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
    2008-09-12 11:45:11,171 INFO [STDOUT] USer flag ..[Ljava.lang.String;@115c6cb                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    as i am writing the message failure details to a template...
         //on failure to send messages , reply to the sender about the failure
                                                                strBuff= tempDetail.writeToTemplate(smsmsg);     
    is that bcoz i am getting an exception

  • Sending mail at release time..

    Hi Friends..
    I have create a workflow for PO.
    Once PO was created workflow got triggered..
    In my Release strategy i set two level of approval..
    My Question is After the approval or rejection of first person the mail will send to
    workflow initiator...
    release of po -
    (po released )- release of po effected..completed
                 \ (po cancelled ) -
    so where i can add the send mail step task..
    Thanks
    Gowrishankar

    If you have copied from standard workflow thne in step 107 and 112 you set an expression : &_WF_Initiator&. You can add some description in task.

  • Error while sending mail using script task in ssis 2008

    Hi,
        i am trying to send mail using ssis 2008 script task.for my requirement i am not able to use send mail task.
    code i have used is
    declared read only variables system::packagename
     Dim PACKAGE As String
            PACKAGE = Dts.Variables("System::PackageName").Value.ToString()
            Dim myHtmlMessage As MailMessage
            Dim mySmtpClient As SmtpClient
            myHtmlMessage = New MailMessage("[email protected]", "[email protected]", "PACKAGE STATUS", PACKAGE + "WAS FAILED")
         mySmtpClient = New SmtpClient("smtp.gmail.com")
            mySmtpClient.Credentials = New NetworkCredential("[email protected]", "mypassword")
            mySmtpClient.EnableSsl = True
            mySmtpClient.Port = 587
            mySmtpClient.Send(myHtmlMessage)
    error i am getting is
    Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
    Authentication Required. Learn more at
       at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
       at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
       at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
    can any one tell me where i am going wrong

    also getting error as follows
    Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
    Authentication Required. Learn more at
       at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
       at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
       at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

  • Server 2008 - Task Scheduler - Send an E-mail fails

    When ever we set an action to send an E-mail in the Server 2008 Task Scheduler GUI, we get a "Task failed" result of
    "Cannot modify or delete an object that was not added using the COM+ Admin SDK (0x8004020D)  once the task gets to that step.
    I have tried creating tasks that do nothing but try and send an email using the new functionality of the Task Manager and it fails with the exact same error, So I have narrowed it down to the email action being the culprit.  As soon as I remove it from the other tasks, everything works as planned.
    Is there a fix for this?  Is there a permission I need to set somewhere?  It seems that some people have tried running the task as the "Network Service" and it works, but I have had no such luck yet.
     

     
    Hi,
    If a task attempts to send an e-mail, but the e-mail doesn't get sent correctly, first make sure that the settings for the e-mail action on the task are set correctly. The e-mail action must have a valid value for the SMTP server, To, and From settings. For more information about these settings, please refer to the following article:
    Actions
    http://technet.microsoft.com/en-us/library/cc722129.aspx
    Make sure the SMTP server that sends the e-mail is setup correctly. E-mail is sent using NTLM authentication for Windows SMTP servers, which means that the security credentials used for running the task must also have privileges on the SMTP server to send e-mail. If the SMTP server is a non-Windows based server, then the e-mail will be sent if the server allows anonymous access.
    For information about setting up the SMTP server, please see the following article:
    SMTP Server Setup
    http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/e4cf06f5-9a36-474b-ba78-3f287a2b88f2.mspx?mfr=true
    And for information about managing SMTP server settings, please see the following article:
    SMTP Administration
    http://technet.microsoft.com/en-us/library/cc758258.aspx
    Hope it helps.
    Tim Quan - MSFT

  • Script task fails to send mail to GMAIL

    Hi   guys ,
       I am new here and i am glad i that i am here.  I am working in a company  as SQL Server developer(T-sql), i am learning SSIS because  i wanted to move to data warehousing.
    I not familiar and i don't know any thing about  C#,  but i am learning SSIS on my own.
    I tried to send mail to gmail  using script task , both sender and receiver with same mail ID using variables which i tried using tutorial i found from the below link.
    [quote]http://www.codeproject.com/Articles/85172/Send-Email-from-SSIS-with-option-to-indicate-Email[/quote]
    but finally when i execute the task , it returns failure message and email is not sent.
    [quote]SSIS package "Send mail using script task.dtsx" starting.
    Error: 0x8 at Script Task: The script returned a failure result.
    Task failed: Script Task
    SSIS package "Send mail using script task.dtsx" finished: Success.
    [/quote]
    Below message taken from progress tab
    [quote]Error: The script returned a failure result.[/quote]
    Can you all please help me in  finding where i am going wrong? please check below code which i have used in script task.
    Microsoft SQL Server Integration Services Script Task
    Write scripts using Microsoft Visual C# 2008.
    The ScriptMain is the entry point class of the script.
    using System;
    using System.Data;
    using Microsoft.SqlServer.Dts.Runtime;
    using System.Windows.Forms;
    using System.Text.RegularExpressions;
    using System.Net.Mail;
    namespace ST_9bc84810a62a401aa44ddd905bcd369d.csproj
    [System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
    public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
    #region VSTA generated code
    enum ScriptResults
    Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
    Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
    #endregion
    The execution engine calls this method when the task executes.
    To access the object model, use the Dts property. Connections, variables, events,
    and logging features are available as members of the Dts property as shown in the following examples.
    To reference a variable, call Dts.Variables["MyCaseSensitiveVariableName"].Value;
    To post a log entry, call Dts.Log("This is my log text", 999, null);
    To fire an event, call Dts.Events.FireInformation(99, "test", "hit the help message", "", 0, true);
    To use the connections collection use something like the following:
    ConnectionManager cm = Dts.Connections.Add("OLEDB");
    cm.ConnectionString = "Data Source=localhost;Initial Catalog=AdventureWorks;Provider=SQLNCLI10;Integrated Security=SSPI;Auto Translate=False;";
    Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
    To open Help, press F1.
    public void Main()
    string sSubject = "Test Subject";
    string sBody = "Test Message";
    int iPriority = 2;
    if (SendMail(sSubject, sBody, iPriority))
    Dts.TaskResult = (int)ScriptResults.Success;
    else
    //Fails the Task
    Dts.TaskResult = (int)ScriptResults.Failure;
    public bool SendMail(string sSubject, string sMessage, int iPriority)
    try
    string sEmailServer = Dts.Variables["sEmailServer"].Value.ToString();
    string sEmailPort = Dts.Variables["sEmailPort"].Value.ToString();
    string sEmailUser = Dts.Variables["sEmailUser"].Value.ToString();
    string sEmailPassword = Dts.Variables["sEmailPassword"].Value.ToString();
    string sEmailSendTo = Dts.Variables["sEmailSendTo"].Value.ToString();
    string sEmailSendCC = Dts.Variables["sEmailSendCC"].Value.ToString();
    string sEmailSendFrom = Dts.Variables["sEmailSendFrom"].Value.ToString();
    string sEmailSendFromName = Dts.Variables["sEmailSendFromName"].Value.ToString();
    SmtpClient smtpClient = new SmtpClient();
    MailMessage message = new MailMessage();
    MailAddress fromAddress = new MailAddress(sEmailSendFrom, sEmailSendFromName);
    //You can have multiple emails separated by ;
    string[] sEmailTo = Regex.Split(sEmailSendTo, ";");
    string[] sEmailCC = Regex.Split(sEmailSendCC, ";");
    int sEmailServerSMTP = int.Parse(sEmailPort);
    smtpClient.Host = sEmailServer;
    smtpClient.Port = sEmailServerSMTP;
    System.Net.NetworkCredential myCredentials =
    new System.Net.NetworkCredential(sEmailUser, sEmailPassword);
    smtpClient.Credentials = myCredentials;
    message.From = fromAddress;
    if (sEmailTo != null)
    for (int i = 0; i < sEmailTo.Length; ++i)
    if (sEmailTo[i] != null && sEmailTo[i] != "")
    message.To.Add(sEmailTo[i]);
    if (sEmailCC != null)
    for (int i = 0; i < sEmailCC.Length; ++i)
    if (sEmailCC[i] != null && sEmailCC[i] != "")
    message.To.Add(sEmailCC[i]);
    switch (iPriority)
    case 1:
    message.Priority = MailPriority.High;
    break;
    case 3:
    message.Priority = MailPriority.Low;
    break;
    default:
    message.Priority = MailPriority.Normal;
    break;
    //You can enable this for Attachments.
    //SingleFile is a string variable for the file path.
    //foreach (string SingleFile in myFiles)
    // Attachment myAttachment = new Attachment(SingleFile);
    // message.Attachments.Add(myAttachment);
    message.Subject = sSubject;
    message.IsBodyHtml = true;
    message.Body = sMessage;
    smtpClient.Send(message);
    return true;
    catch (Exception ex)
    return false;
    Please help me resolve this guys ... THANKS IN ADVANCE

    Thank you very much for your reply @Elvis Long,
    Sorry for the late reply
    Actually, i am not trying or executing this task  from my office , but i am trying this at my home :( .
    sEmailPort has value 587 sEmailServer has smtp.gmail.com
    Can you please check whether this C# coding is correct or not ? because finally it gives error saying "Script
    Task: The script returned a failure result" 
    so can you please check this with your system and let me know what is wrong with this code
    Thanks in advance  

  • Script task to convert output from a sql query into send mail task body formatting

    SSIS 2008R2 Version
    Code from script task
       Microsoft SQL Server Integration Services Script Task
       Write scripts using Microsoft Visual C# 2008.
       The ScriptMain is the entry point class of the script.
    using System;
    using System.Data;
    using Microsoft.SqlServer.Dts.Runtime;
    using System.Windows.Forms;
    namespace ST_29dd6843bd6c4aee9b1656c1bbf55ba8.csproj
        [System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
        public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
            #region VSTA generated code
            enum ScriptResults
                Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
                Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
            #endregion
            public void Main()
                Variables varCollection = null;
                string header = string.Empty;
                string message = string.Empty;
                Dts.VariableDispenser.LockForWrite("User::gsEmailMessage");
                Dts.VariableDispenser.LockForWrite("User::gsWebserviceName");
                Dts.VariableDispenser.LockForWrite("User::gsNoOfCallsInADay");
                Dts.VariableDispenser.LockForWrite("User::gsCalledBySystem");
                Dts.VariableDispenser.GetVariables(ref varCollection);
                //Set the header message for the query result
                if (varCollection["User::gsEmailMessage"].Value == string.Empty)
                    header = "Hi, Count is greater then 50 :\n\n";
                    //header = "Execute SQL task output sent using Send Email Task in SSIS:\n\n\n";
                    header += "----------------------------------------------------------------------------------------------------------------------" + "\n";
                    header += string.Format("{0}\t\t\t\t{1}\t\t{2}\n", "WebService Name", "No Of Calls In A Day", "Called By System");
                    header += "----------------------------------------------------------------------------------------------------------------------" + "\n";
                    varCollection["User::gsEmailMessage"].Value = header;
                //Format the query result with tab delimiters
                     message = String.Format("<HTML><BODY><P>{0}</P><P>{1}</P><P>{2}</P></BODY></HTML>",
                                            varCollection["User::gsWebserviceName"].Value,
                                            varCollection["User::gsNoOfCallsInADay"].Value,
                                            varCollection["User::gsCalledBySystem"].Value);
                varCollection["User::gsEmailMessage"].Value = varCollection["User::gsEmailMessage"].Value + message + "\n";
                Dts.TaskResult = (int)ScriptResults.Success;
    Above code will return data in below format and then i send this output in aemail using send mail task.
    Hi, count is greater then 50 :
    WebService Name                                                         
    No Of Calls In A Day                        Called By System
    WebServiceone                                                     1                             
    Internetbutiken
    WebServiceGetdetailstwo                                                  1                             
    Internetbutiken
    Servicenamethree                                                            2                             
    MOB
    As you can see above code is not in align as if we service name is shorter then 2nd column get disallign and its not look good.I need output should be like below.
    Hi, count is greater then 50 :
    WebService Name                                                         
    No Of Calls In A Day                        Called By System
    WebServiceone                                                              1                             
    Internetbutiken
    WebServiceGetdetailstwo                                              1                             
    Internetbutiken
    Servicenamethree                                                          2                             
    MOB
    Please suggest something...
    Thanks 
    SR_MCTS

    See code explained here
    http://microsoft-ssis.blogspot.in/2013/08/sending-mail-within-ssis-part-2-script.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
    This will not help.As I am not creating smtp connectin ,send from ,send to in script task.I am just creating email body from sql output.

  • Printing Long text in Send Mail Task

    Hi All,
    My requirement is to print the long text of particular error message in the send mail task, which will be sent to outlook.
    for this i have an activity beforr the mail task, where i have filled the multiline parameter called 'TEXT' and this is exported to workflow also.
    In my send mail task, in the body of the message, using insert expression i have inserted the multiline container 'TEXT' with the option of line break, so it came &TEXT##&.
    But once the WF is executed , i checked the WF log and found that the mail is sent and i have checked the container 'TEXT' in my previous activity where the TEXT container has 10 lines.
    But when i checked the mail in SOST the contents of TEXT is not getting printed.
    What will be the issue?
    Thanks and Regards,
    Swaminathan

    @Rick
    How is TEXT defined in the container? Is it passed in via the binding?
    I think if at all you want to use the container element in the mail then binding is not necessary from workflow to task.
    @Swaminathan PJ 
    the multiline container 'TEXT' with the option of line break, so it came &TEXT##&.
    Try to print the entire text continuosly with out line breaks then it works.

  • Dynamic 'Include Text' syntax not working in Send mail task.

    Hi all,
    I want to send some dynamic text via send mail task to agents.
    I tried creating a standard text in SO10. In send mail task in Descriiption tab added the below syntax to call inculde text.
    "INCLUDE ZTEST OBJECT TEXT ID ST LANGUAGE EN". This works and i can see the text in mail  in my sap inbox.
    Now when I try to add text using a variable as below it simply display the sytax and not the text in ZTEST.
    "INCLUDE  &VAR1& OBJECT TEXT ID ST LANGUAGE EN"  *Where VAR1 = ZTEST.
    Please let meknow if i am missing something.
    Thanks
    Edited by: Sunny80 on Oct 20, 2009 11:02 AM
    Edited by: Sunny80 on Oct 20, 2009 11:04 AM

    Hello ,
    Please provide the details as how it is resolved so that others can follow.
    thanks
    srinivas.

  • Mail not received sent through SMTP Send Mail Task

    Hi,
    I have a SSIS package which will send mail notifications. This package is deployed on Integration Services Catalogues as Project deployment. This package having a list of notifications regarding the task status.The receiver end got few
    notifications but missed of the notifications. This issue is not frequent. Sometimes we are getting all notifications. Sotimes missing some notification. All these using SMTP tasks with same SMTP connection. 
    I checked the task status in Standard Reports for all Executions. The task status for all these notification tasks are Success.
    What are the possible reasons for this?
    Thanks and regards,
    Muhammed Shakeer
    Muhammed Shakeer

    Hi Muhammed,
    If the issue happens sometime only and all executions was run successfully, then the issue should be caused by the SMTP server. The SMTP server may refuse the connections.
    To verify the cause, please:
    Check SMTP server log
    Enable logging for the SMTP task. Check the log after execution
    To understand how to enable Logging, please see:
    http://technet.microsoft.com/en-us/library/ms181205(v=sql.110).aspx
    Thanks,
    Jinchun Chen

  • Send mail using CL_BCS through function module, run in background task.

    Hi,
    I am running a function module in Background task. in this function module I am sending mail using CL_BCS class.
    but mail is not generated. if I run the same function Module in foreground mail generated successfully....
    can anyone please tell me the reason behind this.

    Hi i realise that The LIST_TO_ASCII thing is not working correctly in background because the the list-processing in beckground is working not the same as in dialog i think.
    I can only get the last page of the list out when running in background. Any solution to this?
    my code:
        CALL FUNCTION 'LIST_TO_ASCI'
             EXPORTING
                  list_index         = sy-lsind
             TABLES
                 list_dyn_ascii = downtab
             EXCEPTIONS
                  empty_list         = 1
                  list_index_invalid = 2
                  OTHERS             = 3.
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.
    Thanks ,
    LH

  • Send Mail Task runnig OK but doont send the mail

    Hi Experts,
    My workflow is running OK, the Send Mail task is OK without erros but in SOST there are no items.
    It was working until July 14, after this day no more entries in SOST.
    Can Anyone help-me ?

    Hello,
    Could it be a problem with the mail system? Are you sure mails haven't arrived - it could be that your search in SOST is having problems. I think there's a checkbox for "Transmitted" which is unchecked by default.
    Check in the workflow log (SWI1) whether the SendMail steps after July 14th had any errors.
    Check ST22 for any matching dumps.
    What happens if you send a mail manually from SBWP, does it work?
    regards
    Rick Bakker
    hanabi technology

  • Configure different contacts in Send mail task

    Hi experts,
    please help in below doubt
    How to configure the send mail task to use different contacts in different environment with environment variable ?
    Thanks

    hi ,
    You can set your Recipient list in one variable then in send mail use can set that variable value in expression for
    TOLine.
    You can use below link;
    http://stackoverflow.com/questions/5075073/send-email-to-dynamic-recipient-ssis-send-mail-task
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com

  • Send mail from windows server 2008

    Hi all,
    I have developed one web application on windows xp platform, which will send mails on request (using javamail api).
    But it is not able to send mails from windows server 2008, what should I do .. ?
    Thanks & Regards,
    Abel

    Thanks for reply.
    Here my answers for above questions :
    The web application which is deployed in the server is not able to send mails.
    I'm not getting any exceptions.
    I don't know what the protocol trace show.
    I don't know how to debug my application, which was working fine in my development environment,but giving error result(not working fine in deployed system).
    Regards,
    Abel

  • Send mail from follow up actions for tasks in service notifications!

    Dear All,
    I want to send mail to the user from a follow up action in the task assigned to a service notification.
    In customizing which function module I should select for follow up actions for tasks?
    Thanks and Regards,
    Satyajit P

    Hi,
    You can use function module QM06_FM_TASK_SEND_PAPER or QM06_FM_TASK_SEND_PAPER_ATTACH.The document is sent only after the associated notification is saved.You need to enter the function module "QM06_SEND_REPLY_STEP2" in Customizing of the action box as "FM when saving".

Maybe you are looking for