Make task befor send mail. Use of "Show Progress" and Exception

Hello,
Could I handle Send Event of MailItem in a way that Outlook understand it.
I want to do a long task before sending the mail. The user musn't be block. I wish Outlook display the task when user click on "Show progress" I have two choise actualy:
- I cancel upload while my task ending.
- I make a new thread were i do all the process and finally call the mailItem send method
The first seems to work pretty well. But it need the user wait to the end of the process before send. As it didn't block the user to write read others mail it could be a solution.
I prefered the second one who don't change the user experience. But i have many problem to do it :
- How to apeared in "Show progress"
- Exception raise when i send a (draft)mailItem show in preview pane.
Thanks.

That is how Outlook Object Model works. Prior to Outlook 2013, some things would work on secondary threads, but sometimes they would blow up in a really spectacular fashion. So in Outlook 2013 Microsoft made a decision to raise an exception immediately as
soon as Outlook detects that one of its objects is used on a thread other than the primary Outlook thread.
This applies to the COM addins only of course since when your code is running inside the outlook.exe process. If you are out-of-proc, all calls will be marshaled to the main Outlook thread anyway, which negates the whole purpose of using multiple threads
to begin with.
Only Extended MAPI (C++ or Delphi) can be safely used on a secondary thread. You can also use the
RDO family of objects in
Redemption - it wraps Extended MAPI and can be safely used on a secondary thread from any language. See also
http://www.dimastr.com/redemption/faq.htm#Threads
Dmitry Streblechenko (MVP)
http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available!

Similar Messages

  • For some reason yesterday and today I can not send mail using the icloud website and help?

    From some reason I can not send emails using the icloud website.  Not sure why any help

    Hi there tamarafromdarien,
    You may find the troubleshooting steps for iCloud Mail in the article below helpful.
    iCloud: Troubleshooting iCloud Mail
    If you can't send mail in OS X Mail
    If you receive this alert or a similar alert when sending a message from your iCloud email address in OS X Mail:
    “This message could not be delivered and will remain in your Outbox until it can be delivered. The reason for the failure is: An error occurred while delivering this message via the smtp server: server name.”
    In OS X Mail, choose Preferences from the Mail menu.
    Click Accounts in the Preferences window.
    Select your iCloud account from the list of accounts.
    Click the Account Information tab.
    Choose your iCloud account from the Outgoing Mail Server (SMTP) pop-up menu. Example: “Derrick Parker (iCloud)”.
    Note: The Outgoing Mail Server (SMTP) menu also includes an Edit SMTP Server List command. If you choose this command, be aware that the iCloud SMTP server won't be among the servers that can be edited. This is normal.
    If you're attaching a large file
    Message attachments can't exceed the maximum size allowed by your email service provider or the recipient's email service provider. The maximum size varies by service provider. Try compressing the filebefore sending it, or send your message without the attachment to verify that there are no issues with sending.
    -Griff W.  

  • 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()

  • 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

  • My i pad was purchased by my husband using his credit card but now when i send mails using icloud account to shows like is coming from him. how can i change his name to mine

    my i pad was purchased by my husband using his credit card but now when i send mails using icloud account to shows like is coming from him. how can i change his name to mine

    MacBook Airs won't run Classic, nor will Classic connect to iCloud accounts.    You will need your Mac OS X version to answer the question involved.    Go to Apple menu -> About This Mac, and post in the appropriate forum in the link below:
    https://discussions.apple.com/docs/DOC-2463

  • Yosemite mail v8.0 not showing how many messages are in a mailbox. For example inbox. Before upgrading it used to show how many messages you had in your inbox. anyone know how to switch "on" the number of messages?

    Yosemite mail v8.0 not showing how many messages are in a mailbox. For example inbox. Before upgrading it used to show how many messages you had in your inbox. anyone know how to switch "on" the number of messages? Or has this feature been removed?

    Agreed! This feature was very useful. If you find out how to turn it on, please let me know.
    Apple, there is plenty of room in the window header all the way across on both sides of the word "Inbox". It's important to know many messages are in the Inbox. It provides a progress meter when you're cleaning out mail and striving for inbox zero.

  • Hi, I am new to Mac and i managed to install and configure all the services. Now my issue is when i sending mail using the local server to internal, mail are not receiving. Mail queue showing Connection refused error. Please help me

    I am new to Mac and i managed to install and configure all the services. Now my issue is when i sending mail using the local server to internal, mails are not receiving. Mail queue showing Connection refused error. Please help me
    Thanks
    GIRI

    Try this -> http://support.apple.com/kb/TA38632?viewlocale=en_US

  • The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2013-04-30T16:36:52). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.7.1 Client does not

    Interesting db mail issue. If i click send test mail from sql mgmt studio, it works fine, but when i execute a SP to send a mail, it fails. One thing I noticed is that the "LastModified" column in the mail log shows the domain account when a test
    mail was sent from mgmt studio, but show "sa" when the SP was used to send mail. 
    This is from SQL 2012, did not see this in sql 2008, looks like 2008 always used the service account.  any ideas ?
    Get this error:
    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2013-04-30T16:36:52). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.7.1 Client does not
    Thanks.
    Ranga

    Hi Ranga,
    I also use SQL Server 2012. I send a test email through SQL Server Management and the last modified By “sa”.
    If you used stored procedure to send a test email. Please use the command below:
    EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'Adventure Works Administrator',
    @recipients = '[email protected]',
    @body = 'The stored procedure finished successfully.',
    @subject = 'Automated Success Message' ;
    I can both send test email through SQL Server Management Studio and SP. Make sure you have the right profile. Since you could send test mail via SQL Server Management Studio, please try again to send it via SP.
    Thanks.
    If you have any feedback on our support, please click
    here.
    Maggie Luo
    TechNet Community Support

  • Can we send mails using Oracle

    Hi Everybody,
    Can we send mails using Oracle (like java mail)?? Can I a write a procedure/stored procedure to send a mail if there is any change in the database tables
    null

    There are three Exchange portlets available for use with Portal 3.0.8.9.8 (inbox, calendar, contacts). They will be downloadable from the new Oracle9iAS Portal Partner Catalog which will be up at the end of March. If you wish to use these portlets before then, send me an email request and I will give them to you.

  • SMICM error while sending mail using SMTP server

    Hi All,
    We are not able send mails using SMTP server.
    We have made every settings necessary in SCOT, SO16 , SMTP service is activated, default domain is maintained etc
    Only things which seems to be wrong is in SMICM trace file.
    [Thr 13] *** ERROR => NiBufIConnect: non-buffered connect pending after 5000ms (hdl 29;10.26.24.44:1090) [nibuf.cpp    4608]
    [Thr 13] *** WARNING => Connection request from (0/1/0) to host: 10.26.24.44, service: 1090 failed (NIECONN_REFUSED)
    [icxxconn_mt.c 2321]
    This error is getting repeated in it.
    BUt I am not sure why it it trying to hit 10.26.24.44, as we dont have any server by this ip. The ip is only not resolvable from the server.
    1 more thing, at OS level, following parameter is maintained in profile :
    icm/server_port_1 = PROT=SMTP,PORT=25000,TIMEOUT=180
    But in SCOT, under SMTP node PORT is given as 25.
    Kindly let me know what going wrong here?
    Thanks

    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()

  • Sending mail using smtps protocol

    Could anyone post a piece of code to show how to send a message using smtps protocol?
    SSLNotes of 1.3.2ea version say that it's possibile, but i tried whithout success....
    Thanks

    Hello,
    I can send the mail using SMTP with the help of java mail api. But i want to send mail using SMTPS protocol using java. The mail should be encrypted format.
    So, my queries are:
    1. How to send mail using SMTPS protocol?
    2. I want to send the mail as encryption mail. So how to create encrypted mail.?
    Thanks in advance.
    From
    Rajendra.

  • Cant send mail using selected server

    I havent been able to send mail using my normal 587port with SSL selected.
    Can someone help me???

    A .Mac account has a 10 MB message size limit for incoming and sent messages and attachments must be encoded before being sent which increases the size of the pre-encoded attachment by 50% or so. A single 6 MB attachment can be over 10MB due to the encoding process.

  • Send mail using Dynamic actions

    Hello experts,
    How to send  a mail using Dynamic Actions??
    Requirement : Lets say one employee is hired on 26th Aug, so after 10 days he will be confirmed. so on 8th day need to send a mail to concerned person reminding the confirmation date.
    so how do i do that using dynamic actions??
    Thanks in advance.
    Saurabh

    Hi,
    In dynamic actions there is an option for calling sub-routine from any program or subroutine pool. So u can make subroutine for sending mail according to ur requirement. An call on th same from dynamic actions.
    if u want sample code for this, pls let me know.
    <removed_by_moderator>
    Regards,
    Ranjith
    Edited by: Julius Bussche on Aug 26, 2008 3:25 PM

  • Compress Smartform PDF file before sending mail

    Hi Experts,
    I need to compress PO smartform.Smartform already converted into PDF file.Vendor received this file as an attachement in their mail box.Vendor complains that file size is too large.They want to compress that PDF file before sending mail.
    Anybody can suggest how to compress a smartform which is already converted into PDF.

    Hi Michael/Satyajit,
    First of all thanks for the suggestions.
    Actually I am working for a application maintenance project and after go-live user is complaining that previously the PO form size was 57 KB and after this implementation the form size is 618KB that is not acceptable.
    I checked with the legacy system and found that the previous form was developed using SAPScript,converted to PDF and then used to send as an attachement to user mail box.
    The new development environment using Smartform for PO form and then it is converted to PDF and send as an attachement to user mail box.I checked with the Logo and the logo size is only of 9KB.No other graphics used in the form.The developer had used 3-4 boxes in the form and page format is landscape. Style is used in the form and the used font is courier,font size is 10 pt .
    Will change in style's font and font size reduces the size upto that level??

  • Problems to SEND MAIL using WWV_FLOW_MAIL.SEND - APEX_MAIL

    I tried send mail using the code below
    DECLARE
    l_body      CLOB:= EMPTY_CLOB;
    l_body_html CLOB:= EMPTY_CLOB;
    BEGIN
    wwv_flow_api.set_security_group_id;
    l_body :='<html>
    +<head>+
    +<style type="text/css">+
    +body{font-family: Arial, Helvetica, sans-serif;+
                                   +font-size:10pt;+
                                   +margin:30px;+
                                   +background-color:#ffffff;}+
    +span.sig{font-style:italic;+
    font-weight:bold;
    color:#811919;}
    +</style>+
    +</head>+
    +<body>+
    +</html>';+
    l_body_html := '<html>
    +<head>+
    +<style type="text/css">+
    +body{font-family: Arial, Helvetica, sans-serif;+
                                   +font-size:10pt;+
                                   +margin:30px;+
                                   +background-color:#ffffff;}+
    +span.sig{font-style:italic;+
    font-weight:bold;
    color:#811919;}
    +</style>+
    +</head>+
    +<body>+
    +</html>';+
    wwv_flow_mail.send('[email protected]','[email protected]',nvl(l_body,'Texto com erro'),nvl(l_body_html,'erro2'),'K','[email protected]',
    +'[email protected]','[email protected]');+
    wwv_flow_mail.push_queue;
    END;
    +/+
    This code return the message:
    Mail To From Subject CC BCC Created On Created By Error Created
    CHECK$01 [email protected] [email protected] K [email protected] [email protected] 08/23/2010 03:05:00 PM SYS
    ORA-06502: PL/SQL: erro: erro de conversão de caractere em número numérico ou de valor
    Follow my mail settings
    SMTP Host Address : POP.SLE.TERRA.COM.BR
    SMTP Host Port 110
    Administration Email Address [email protected]
    Notification Email Address [email protected]
    what´s wrong ?

    I would try sending just basic text first, then move on to getting your other pieces dynamics. The very last step to me would be the email body.
    Here is an example of a basic text email I use:
    declare
      e_id        NUMBER;
      c_id        NUMBER;
      emp_nm      VARCHAR2(100);
      clrk_id     NUMBER;
      e_clrk      VARCHAR2(47);
      e_org       NUMBER;
      e_sender    VARCHAR2(50);
      e_recip_lst VARCHAR2(255); 
      e_cc        VARCHAR2(100);
      e_bcc       VARCHAR2(100);
      e_subj      VARCHAR2(50);
      e_msg_ln1   VARCHAR2(100);
      e_msg_ln2   VARCHAR2(100);
      e_msg_ln3   VARCHAR2(100);
      e_msg_ln4   VARCHAR2(100);
      e_msg_ln5   VARCHAR2(100);
      e_msg       VARCHAR2(1000);
      CRLF        CHAR(2) := CHR(13) || CHR(11);
      tmp_flag    NUMBER;
    begin
       if :P2_INJURY_FLAG = 1 then
       -- find out if it has changed first so we don't keep sending emails
        select injury_flag, VEH_LOC
          into tmp_flag, e_org
          from APPS.tc
         where tc_id = :P2_TC_ID;
       if :P2_injury_flag <> tmp_flag then
        begin
           select FN_GET_USER(nvl(v('APP_USER'),user))
             into clrk_id 
             from dual;
          select ADMIN_USERNAME
             into e_clrk
            from APPS.APEX_ACCESS_CONTROL
           where ID = clrk_id;
        exception
           when others then null; -- in case we cannot find the user
        end;
        e_id          :=  :P2_EMP_ID;
        c_id          :=  :P2_TC_ID;
        select EMP_FNAME ||' '|| EMP_MNAME ||' '|| EMP_LNAME into emp_nm
          from APPS.EMPLOYEES
         where EMP_ID = e_id;  --
        select RECIPIENTS, CC, BCC
          into e_recip_lst, e_cc, e_bcc
          from APPS.SAFETY_NOTIFICATIONS
         where ORG_ID = e_org;  --
          e_sender    :=  '[email protected]';
          e_subj      :=  'Loss Reported';
          e_msg_ln1   :=  'Employee: ' || emp_nm || ' (' || e_id || ')'  
                          || CRLF;
          e_msg_ln2   :=  'Was reported as sustaining a loss' || CRLF;
          e_msg_ln3   :=  'by ' || e_clrk ||CRLF;
          e_msg_ln4   :=  CRLF;
          e_msg_ln5   :=  'Sent ' || to_char(sysdate,'MONTH DD,YYYY HH:MI AM');
          e_msg       :=  e_msg_ln1 || e_msg_ln2 || e_msg_ln3 || e_msg_ln4 || e_msg_ln5 || CRLF || e_recip_lst;
         utl_mail.send(
           sender => e_sender,
           recipients => e_recip_lst,
           cc => e_cc,
           bcc => e_bcc,
           subject => e_subj,
           message => e_msg);
      end if;
    end if;
    end;

Maybe you are looking for

  • I can't download a film from the itunes store.

    yesterday, i buyed a film in the itunes store, but now i can't download it., yesterday, i buyed a film in the itunes store, but now i can't download it.

  • Paypal express checkout doesn't display properly - Firefox 33.0.3

    Paypal express checkout doesn't appear to be displaying properly in firefox (link to screenshot below). I've tried it with Chrome & IE and it works fine, so can only assume this is a firefox bug. Screenshot: http://voodoo-london.com/ss.png I've tried

  • Diagnose My Ipod Problem (5G)

    Okay, so i purchased a 5g ipod about 2 weeks ago. THe first day i got i had some ******** problems. I plug in the usb i get a sad ipod face right away and the clicking WHIRR WHIRRR pattern. I cannot reset the ipod. so i spend a few hours researching

  • Importing a PDF(Adobe Acrobat Document) in CR

    Post Author: ThomasD CA Forum: Charts and Graphs HelloI would like to import a PDF into CR as part of my report. It is possible to import a pdf as an ole object.The problem is now, that the quality of the pdf is very bad. It looks like CR compresses

  • When could iphone 5 launch in india ?

    i need iphone5 when it launch in india