SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    235
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ensure email reading

    How can I ensure that the user read the e-mail?
    i want to be sure that the user reads the email using php.. by sending for me a feedback on my mail that the user reads the mail ..

  2. #2
    SitePoint Addict
    Join Date
    Apr 2007
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This can be considered invasion of user privacy.

  3. #3
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    AFAIK, it's just an additional header.
    PHP Code:
    $aMailHeaders[] = sprintf(
        
    '%s: %s',
        
    'Disposition-Notification-To',
        
    '<yourEmailAddress@domain.com>'
    ); 
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  4. #4
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    235
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SilverBulletUK View Post
    AFAIK, it's just an additional header.
    PHP Code:
    $aMailHeaders[] = sprintf(
        
    '%s: %s',
        
    'Disposition-Notification-To',
        
    '<yourEmailAddress@domain.com>'
    ); 
    do u mean that i must put this line in the header of send function in php?? or wheere i can put this line?

  5. #5
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Like so.
    PHP Code:
    $aMailHeaders[] = sprintf(
        
    '%s: %s',
        
    'Disposition-Notification-To',
        
    '<yourEmailAddress@domain.com'
    );

    mail('to''subject''message'implode(chr(13).chr(10), $aMailHeaders)); 
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  6. #6
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    235
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SilverBulletUK View Post
    implode(chr(13).chr(10), [/php]
    sorry for interruption but i want to know what this lines means???
    i will try to make it now on my server
    thnx for ur help

  7. #7
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    It converts the array of headers into a string delimited by \r\n.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  8. #8
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    235
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SilverBulletUK View Post
    It converts the array of headers into a string delimited by \r\n.
    look in my source code there is many headers (from and charset....) and i want to put the last line u have send to me so where i can put it..???

    PHP Code:

    $headers 
    .= "MIME-Version: 1.0\r\n"
    $headers .= "Content-type: text/html; charset=windows-1256\r\n";
    $headers .= "From:  Website Request <info@example.com>\r\n";
                    
    $ok mail($to,$kind$message$headers); 
    i tried to make the following

    PHP Code:
    $aMailHeaders[] = sprintf('%s: %s','Disposition-Notification-To','<yourEmailAddress@domain.com>');
    $ok mail($to,$kind$message, , implode(chr(13).chr(10), $aMailHeaders)); 
    and it works correctly but without from , chareset... did u got it???
    also when i read the mail it show me an alert that there will be respont send to yourEmailAddress@domain.com do u want to send.....

    i dont want this alert i dont want the user to know there is a respond mail sent to the administrator

  9. #9
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by john_zakaria View Post
    i dont want this alert i dont want the user to know there is a respond mail sent to the administrator
    To be fair, nearly all email clients block any attempt to contact an external source when reading email - for this exact reason.

    Personal ethics aside, asking for a read receipt is the best you're going to get.

    PHP Code:
    $headers .= "MIME-Version: 1.0\r\n"
    $headers .= "Content-type: text/html; charset=windows-1256\r\n";
    $headers .= "From:  Website Request <info@example.com>\r\n";
    $headers .= "Disposition-Notification-To: <info@example.com>\r\n";

    $ok mail($to,$kind$message$headers); 
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  10. #10
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    235
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SilverBulletUK View Post
    To be fair, nearly all email clients block any attempt to contact an external source when reading email - for this exact reason.

    Personal ethics aside, asking for a read receipt is the best you're going to get.
    the problem is that te user send for me that he read the mail... but i want to know that he reads the mail after reading it, not before reading it..

    someone told me to attach an image and when the user downloads it , it will send for me a notification mail that the mail is read but i dont know how to do it..
    how to set an image send mail on downloading into the user mail????

    do u have any other ideea

    also i dont want the attached image to be shown to the user .......
    sorry for interruption
    Attached Images Attached Images

  11. #11
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Many nefarious advertisers & spammers track emails by including a unique key on a resource which is loaded externally by a users email client, such as an image.

    Code:
    <img src="trackOpenedEmail.php?id=123456789" />
    The remote script would then log access, therefore the sender would now know 2 things:-

    • The email address is valid.
    • The email was read by the recipient.

    As such, most email clients now block access to remote resources when reading email unless explicitly told not to.

    An alternative? What about sending a one off link, containing a unique key for the user to view the message online? Much like the PM system of a forum?
    Code:
    You have received a message from SilverBulletUK,
    
    To view the message, click <a href="viewMessage.php?id=123456789">here</a>
    
    Thanks,
    
    Admin.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  12. #12
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    235
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SilverBulletUK View Post
    Many nefarious advertisers & spammers track emails by including a unique key on a resource which is loaded externally by a users email client, such as an image.

    Code:
    <img src="trackOpenedEmail.php?id=123456789" />
    The remote script would then log access, therefore the sender would now know 2 things:-

    • The email address is valid.
    • The email was read by the recipient.

    As such, most email clients now block access to remote resources when reading email unless explicitly told not to.

    An alternative? What about sending a one off link, containing a unique key for the user to view the message online? Much like the PM system of a forum?
    Code:
    You have received a message from SilverBulletUK,
    
    To view the message, click <a href="viewMessage.php?id=123456789">here</a>
    
    Thanks,
    
    Admin.

    Do u mean that i will attach from a page that have the send fuction???
    but how coe an image to send mail??? iwill put the send mail function in a page.. but how i can make it related to the image to send the mail??

    i know that i'm making N INTERRUPTION for but really thnx for ur help... i need to make this function quickly..

    could you send for me a full example to stopping my interruption to you?

    really thank you


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •