p_partha
asked on
Strange problem with read reciepts
Dear Experts
This sample code would send return reciept back to "abc@experts-exchange.com" irrespective of whoever sent the email from the notes client, but for some users , it's sending back the read reciept to the original sender
Any ideas are appreciated
Dim memo As notesdocument
Set memo = New NotesDocument( db )
memo.Form = "Memo"
Set rtitem = New NotesRichTextItem( Memo, "Body" )
memo.Subject = newdoc.subject(0)
Call newdoc.copyallitems(memo,F alse)
success = NewDoc.RenderToRTItem( rtitem )
Set bccitem = memo.GetFirstItem( "BlindCopyTo")
memo.blindcopyto = tmpitem.values
memo.ReturnReceipt = "1"
memo.replyto = "abc@experts-exchange.com"
memo.send False
- Partha
This sample code would send return reciept back to "abc@experts-exchange.com"
Any ideas are appreciated
Dim memo As notesdocument
Set memo = New NotesDocument( db )
memo.Form = "Memo"
Set rtitem = New NotesRichTextItem( Memo, "Body" )
memo.Subject = newdoc.subject(0)
Call newdoc.copyallitems(memo,F
success = NewDoc.RenderToRTItem( rtitem )
Set bccitem = memo.GetFirstItem( "BlindCopyTo")
memo.blindcopyto = tmpitem.values
memo.ReturnReceipt = "1"
memo.replyto = "abc@experts-exchange.com"
memo.send False
- Partha
ASKER
I want the read reciept to go abc@ee, not to the sender
this is one of the ways we are tracking how many are really opening up the emails. All the emails are internal bro.
Partha
this is one of the ways we are tracking how many are really opening up the emails. All the emails are internal bro.
Partha
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thx bro
memo.ReturnReceipt = "1" ' this line ensures that return receipt is sent . Also, the users want to retain their names when sent, that's why I didn't change the principal field, but i will give it a shot, will wait to hear from you whether there are any other fields that influence the return reciept to the sender apart from "replyto"
Partha
memo.ReturnReceipt = "1" ' this line ensures that return receipt is sent . Also, the users want to retain their names when sent, that's why I didn't change the principal field, but i will give it a shot, will wait to hear from you whether there are any other fields that influence the return reciept to the sender apart from "replyto"
Partha
It's in the Common scriptlibrary, the function wReturnReceipt:
Function wReturnReceipt( note As notesdocument )
Dim receipt As notesdocument
If (note.HasItem("DeliveredDa te")) And (note.getitemvalue("Return Receipt")( 0) = "1") Then
If Not NameCompare(session.Effect iveUserNam e,note.Get ItemValue( "From")(0) ) Then
Set receipt = New NotesDocument (db)
Call receipt.replaceitemvalue(" Form", "Return Receipt")
If wGetCalendarProfile() Then
Call receipt.replaceitemvalue(" IntendedRe cipient", Owner)
Else
Call receipt.replaceitemvalue(" IntendedRe cipient", session.CommonUserName)
End If
Dim dtNow As New NotesDateTime ("")
Call dtNow.setNow()
Call receipt.replaceitemvalue(" DeliveryDa te", dtNow)
Call receipt.replaceitemvalue(" Path_Info" , note.getitemvalue("RouteSe rvers")(0) )
Call receipt.replaceitemvalue(" Subject",n ote.getite mvalue("Su bject")(0) )
Call receipt.MakeResponse(note)
Call receipt.send (False, note.getitemvalue("From")( 0)) ' <--- the receipt is sent to From...
Call note.replaceitemvalue("Ret urnReceipt ", "0")
Call note.Save (True, False)
End If
End If
End Function
So if you know how to set the From differently, you can change the destination for a return receipt. All the same, this method seems a bit tricky to me, relying on code in the user's database. If it were up to me, I'd remove return receipts altogether, I don't want to send a confirmation to the sender whatsoever (think of spam...).
I suppose you don't send mails with forms? If you did, it would be easier to send you a "receipt", e.g. in the PostOpen.
Function wReturnReceipt( note As notesdocument )
Dim receipt As notesdocument
If (note.HasItem("DeliveredDa
If Not NameCompare(session.Effect
Set receipt = New NotesDocument (db)
Call receipt.replaceitemvalue("
If wGetCalendarProfile() Then
Call receipt.replaceitemvalue("
Else
Call receipt.replaceitemvalue("
End If
Dim dtNow As New NotesDateTime ("")
Call dtNow.setNow()
Call receipt.replaceitemvalue("
Call receipt.replaceitemvalue("
Call receipt.replaceitemvalue("
Call receipt.MakeResponse(note)
Call receipt.send (False, note.getitemvalue("From")(
Call note.replaceitemvalue("Ret
Call note.Save (True, False)
End If
End If
End Function
So if you know how to set the From differently, you can change the destination for a return receipt. All the same, this method seems a bit tricky to me, relying on code in the user's database. If it were up to me, I'd remove return receipts altogether, I don't want to send a confirmation to the sender whatsoever (think of spam...).
I suppose you don't send mails with forms? If you did, it would be easier to send you a "receipt", e.g. in the PostOpen.
ASKER
We used to send with forms, but we had some issues with blackberries so we reverted back to normal email since we do lot of formatting and stuff..
But bro, is this code from the mail template?
partha
But bro, is this code from the mail template?
partha
Yep, it's in the R7 mail template, in the scriptlib called Common. Ah, no, you're not thinking of changing the mail template are you?? Oh dear... ;-))
ASKER
no way i can do that :)), i dont' even have access to it. but i will try changing the "From" and "Inetfrom" and see what happens
Thx for the lead bro
Partha
Thx for the lead bro
Partha
ASKER
Looks like you cannot change the "From" field programmatically :((
- Partha
- Partha
No you can't :| It's supplied by Notes. It would have been a great way to achieve some sort of workflow, by the way! You send a message to Mr. One; when he opens the message you receive a receipt, so you can send a message to Mr. Two, etc.
Alas, in this case, as it is with many things: Notes doesn't work that way... But why receipt messages sometimes get sent one way and another time another way I don't know.
Alas, in this case, as it is with many things: Notes doesn't work that way... But why receipt messages sometimes get sent one way and another time another way I don't know.
Code is a little messed up to begin with. Obvioulsy had stuff added on without paying attention to what was already there. Otherwise, would never have the line where the subject is copied followed by copying all items... first line is then redundant.
Also, I doubt you need all the field copied from the original memo. Let's go with something simpler, which does NOT copy all those original fields, especially the addressing fields.
But first, I need to understand something. Are you expecting the code above to CREATE the retrun receipt message, or to create a message that automatically creates a retrun receipt when that message is opened? Becasue that's what you've done -- you've sent the MEMO object, with the ReturnReceipt field set on. The line memo.Send false essentially creates new messages in SOMEONE's mailbox. When those messages are opened, a retrun receipt automatically goes to the ReplyTo address.
Also, I doubt you need all the field copied from the original memo. Let's go with something simpler, which does NOT copy all those original fields, especially the addressing fields.
But first, I need to understand something. Are you expecting the code above to CREATE the retrun receipt message, or to create a message that automatically creates a retrun receipt when that message is opened? Becasue that's what you've done -- you've sent the MEMO object, with the ReturnReceipt field set on. The line memo.Send false essentially creates new messages in SOMEONE's mailbox. When those messages are opened, a retrun receipt automatically goes to the ReplyTo address.
ASKER
Qwal
Thx for your response,you can ignore the newdoc line as it was used to render the email using a particular form. Yes I want the mail to go to somebody's mailbox and when he opens shd send a read receipt to a abc@ee.com, irrespective of whoever sent it
Hope i am clear
Partha
Thx for your response,you can ignore the newdoc line as it was used to render the email using a particular form. Yes I want the mail to go to somebody's mailbox and when he opens shd send a read receipt to a abc@ee.com, irrespective of whoever sent it
Hope i am clear
Partha
Crystal ;-))
Can you send them a partial mail, so they have to press a button to read all of it??
"Blah blah, important message, blah blah, press this button --->" | READ MESSAGE |
Hide-whens? Message in external database?
Can you send them a partial mail, so they have to press a button to read all of it??
"Blah blah, important message, blah blah, press this button --->" | READ MESSAGE |
Hide-whens? Message in external database?
In addition to ReplyTo, you should also set Principal to the same value.
ANd I was more concerned with the CopyAllItems. Never use that unless you need the new document to be idnetical with the old. In this case, you r eally don't need that, you just need maybe one or two fields (Subject, probably nothing else). The way you have it, you're also copying the old SendTo, CopyTo, BlindCopyTo, Principal, and who knows what else, and that could be causing problems.
Finally, you set your BCC variable, then never use it. Overall, this code needs to be rewritten, it is a mess.
ANd I was more concerned with the CopyAllItems. Never use that unless you need the new document to be idnetical with the old. In this case, you r eally don't need that, you just need maybe one or two fields (Subject, probably nothing else). The way you have it, you're also copying the old SendTo, CopyTo, BlindCopyTo, Principal, and who knows what else, and that could be causing problems.
Finally, you set your BCC variable, then never use it. Overall, this code needs to be rewritten, it is a mess.
ASKER
Sjef
I suggested all your ideas...
Qwal,
I have pasted only a small part of the bigger picture. The newdocument has couple of sections, which I am using to populate with some values(i know we can directly create sections), also the bcc variable is also used, but i have removed that here...But if i change the prinicipal, it changes the sender name which they don't want... it's just that we are capturing how many of them really opening their emails
Partha
I suggested all your ideas...
Qwal,
I have pasted only a small part of the bigger picture. The newdocument has couple of sections, which I am using to populate with some values(i know we can directly create sections), also the bcc variable is also used, but i have removed that here...But if i change the prinicipal, it changes the sender name which they don't want... it's just that we are capturing how many of them really opening their emails
Partha
ASKER
also qwal, copyallitems second parameter is false, so doesn't overwrite any of the already existing fields
Partha
Partha
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I also move to change the title of this question. It is not so much a "Strange problem with read receipts" but more a "Request to divert read receipts, which might accidentally work because Notes handles receipts in a strange way".
Sjef :-))
Sjef :-))
Furthermore, what do you want? I suppose that a Return Receipt should be sent to the originator of the mail, and not to abc@ee. Is that what you want? Is there any logic in the addresses that send the receipts correctly, or not? E.g. are they all Internet addresses? Or are they all Outlook Express users, and the correct ones are sent by Thunderboid?