• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

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

0
bsharath
Asked:
bsharath
  • 6
  • 6
  • 2
1 Solution
 
peakpeakCommented:
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.
0
 
David LeeCommented:
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.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
bsharathAuthor Commented:
David when i set it to Off it takes it as Read & Deliver for all mails automatically without asking me Yes/No
0
 
David LeeCommented:
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?
0
 
bsharathAuthor Commented:
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
0
 
David LeeCommented:
Ok.  I've added a new switch for sending bulk mail.  When it is on you will not be prompted and receipts will not be requested.  When it is off, then you will be prompted for receipts based on whether the other two switches are on or off.  You'll need to create another toolbar button to control the bulk mail switch.
'Add this to your existing code'
Private bolBulkMail As Boolean

'Adde this subroutine to your existing code'
Sub BulkMailSwitch()
    bolBulkMail = Not bolBilkMail
    MsgBox "The bulk mail switch is now " & IIf(bolBulkMail, "on", "off")
End Sub

'Replace the existing Application_ItemSend subroutine with the version below' 
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 bolBulkMail Then
        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
    End If
    'CheckFollowUp Item, Cancel
    Item.Save
End Sub

Open in new window

0
 
bsharathAuthor Commented:
David Should i replace the whole code with the above?

Can you post the full code editted if its not just this...Please..
0
 
bsharathAuthor Commented:
Hi David ...Just a reminder when time permits....
0
 
David LeeCommented:
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.  
0
 
bsharathAuthor Commented:
Should i replace the code in the class or Thisoutlooksession
0
 
David LeeCommented:
ThisOutlookSession
0
 
bsharathAuthor Commented:
Thank U David
0
 
David LeeCommented:
You're welcome.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now