Link to home
Start Free TrialLog in
Avatar of bsharath
bsharathFlag for India

asked on

When i send bulk mails when i want to switch it Off. When i select No while selecting the macro directly. It gets into a phase where for all emails sent it asks for delivery and read receiptiant.

Hi,

Below code is from David.

The below code ask's me if i want a delivery notice and read notice on each email sent it pop's up.

When i send bulk mails when i want to switch it Off. When i select No while selecting the macro directly. It gets into a phase where for all emails sent it asks for delivery and read receiptiant.
When i say No i want it to stop requesting for receptiants and when i selected Yes it has to ask for all without prompting each time. On Close and open of Outlook it has to get back to the normal phase of asking me on each mail sent.

Regards
Sharath
Sub ReceiptSwitch()
'Read and delivery report swtch
 
    bolReadReceipt = Not bolReadReceipt
    bolDeliveryReceipt = Not bolDeliveryReceipt
    MsgBox "Read and delivery receipts are now " & IIf(bolReadReceipt, "on", "off")
End Sub
 
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Dim olkRecipient As Outlook.Recipient
    For Each olkRecipient In Item.Recipients
        LogAddress olkRecipient.Name, olkRecipient.Address
    Next
    Set olkRecipient = Nothing
    toMe Item
    If (Not bolReadReceipt) And (Not bolDeliveryReceipt) Then
        If MsgBox("Do you want receipts for this message?", vbQuestion + vbYesNo, "Request Receipts") = vbYes Then
            Item.ReadReceiptRequested = True
            Item.OriginatorDeliveryReportRequested = True
        End If
    Else
        Item.ReadReceiptRequested = bolReadReceipt
        Item.OriginatorDeliveryReportRequested = bolDeliveryReceipt
    End If
    'CheckFollowUp Item, Cancel
    Item.Save
End Sub

Open in new window

Avatar of peakpeak
peakpeak
Flag of Sweden image

A read or delivery receipt is quite futile to use as it can give a false negative when the receiving mail system does not support these kind of messages. If you're not receiving a receipt you might be of the impression the mail is not read when it actually is. It's all dependend on the recipients mail system.
Avatar of David Lee
Hi, Sharath.

Why don't you just set the switch to off before you send a bulk message?  That is a lot easier and won't require changing the code.
Avatar of bsharath

ASKER

David when i set it to Off it takes it as Read & Deliver for all mails automatically without asking me Yes/No
You don't want receipts for the bulk messages, correct?  If so, then what we need is another switch for bulk mails.  If that switch is on, then no receipts at all.  Will that work?
Yes David...
One option to get a popup each sent email
Another option to Keep it on on all emails another option to keep it off always
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
David Should i replace the whole code with the above?

Can you post the full code editted if its not just this...Please..
Hi David ...Just a reminder when time permits....
Sharath,

I'm not clear on what you mean when you ask "Should i replace the whole code with the above?"  The answer is "yes" for the code for this question but "no" for all the code you have in ThisOutlookSession.  
Should i replace the code in the class or Thisoutlooksession
ThisOutlookSession
Thank U David
You're welcome.