+ Reply to Thread
Results 1 to 7 of 7

Thread: PHP mail() hiding recipients

  1. #1
    Mitch's Avatar
    Mitch is offline x10 Elder Mitch is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Netherlands
    Posts
    906

    PHP mail() hiding recipients

    This is my script that i got:

    PHP Code:
    $headers  'MIME-Version: 1.0' "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";

    $headers .= 'From: '.$fromname.' <'.$from.'>' "\r\n";
    //$headers .= "To: \r\n";
    //$headers .= "Cc: \r\n";
    //$headers .= "Bcc: ".$to."\r\n";

    mail($to$subject$message$headers); 
    The thing that i want is: When someone gets a email that is send to more then one person. You only would see your email. Not the other recipients. I have tried to use bcc, but then i have to fill in $to. When you look at that email, you will see that $to (at To:).
    Last edited by Mitch; 02-04-2010 at 11:54 AM.
    My Website: mitch.exofire.net (currenly not really working on it ;))



  2. #2
    marshian's Avatar
    marshian is offline x10 Elder marshian is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    526

    Re: PHP mail() hiding recipients

    Fill in a void entry for "To" and the actual e-mail addresses in "Bcc".
    "To: Undisclosed Recipients <no-reply@mich.exofire.net>\r\n" for example.
    Last edited by marshian; 02-04-2010 at 12:18 PM. Reason: typo
    Real programmers don't document their code - if it was hard to write, it should be hard to understand.

  3. #3
    Mitch's Avatar
    Mitch is offline x10 Elder Mitch is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Netherlands
    Posts
    906

    Re: PHP mail() hiding recipients

    Quote Originally Posted by marshian View Post
    Fill in a void entry for "To" and the actual e-mail addresses in "Bcc".
    "To: Undisclosed Recipients <no-reply@mich.exofire.net>\r\n" for example.
    Ok, i will try that. I have got that. It works. But i would like if it is possible that it shows only your email. Not that email that you set yourself.
    Last edited by Mitch; 02-04-2010 at 01:42 PM.
    My Website: mitch.exofire.net (currenly not really working on it ;))



  4. #4
    marshian's Avatar
    marshian is offline x10 Elder marshian is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    526

    Re: PHP mail() hiding recipients

    Sorry, but I don't understand what you're saying now, your sentence makes no sense...
    Do you want the user to see his own mail address and nothing else?
    That'd be a bit hard, the "To" header gets send to every recipient, so it's never going to work with just one mail. In fact, it would only be possible if you loop over each user and send each one of them a separate mail. But that would certainly cause problems, since sending huge amounts of mails in few time will trigger x10's spam protection. On your own server you could do that, but not on x10.

    So in short: it's only possible if you don't fear x10's spam protection.
    Real programmers don't document their code - if it was hard to write, it should be hard to understand.

  5. #5
    Mitch's Avatar
    Mitch is offline x10 Elder Mitch is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Netherlands
    Posts
    906

    Re: PHP mail() hiding recipients

    Quote Originally Posted by marshian View Post
    Sorry, but I don't understand what you're saying now, your sentence makes no sense...
    Do you want the user to see his own mail address and nothing else?
    That'd be a bit hard, the "To" header gets send to every recipient, so it's never going to work with just one mail. In fact, it would only be possible if you loop over each user and send each one of them a separate mail. But that would certainly cause problems, since sending huge amounts of mails in few time will trigger x10's spam protection. On your own server you could do that, but not on x10.

    So in short: it's only possible if you don't fear x10's spam protection.
    Ok, i don't think it can be done what i want. Because i tested it with my gmail. Then gmail sets as To "". I think there is no way to fake the To address as the address that the email is sent to.
    My Website: mitch.exofire.net (currenly not really working on it ;))



  6. #6
    fortwienix is offline x10Hosting Member fortwienix is an unknown quantity at this point
    Join Date
    Jan 2010
    Posts
    9

    Re: PHP mail() hiding recipients

    Quote Originally Posted by Mitch View Post
    Ok, i don't think it can be done what i want. Because i tested it with my gmail. Then gmail sets as To "". I think there is no way to fake the To address as the address that the email is sent to.
    Another possibility would be to send an email to each user. Put the recipients in a list and then iterate over the list and fill the To: header with each recipient.
    The disadvantage is that you send an email for each recipient (creating more traffic). The other proposed solution sends one mail with all the recipients in Bcc.

  7. #7
    Mitch's Avatar
    Mitch is offline x10 Elder Mitch is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Netherlands
    Posts
    906

    Re: PHP mail() hiding recipients

    Quote Originally Posted by fortwienix View Post
    Another possibility would be to send an email to each user. Put the recipients in a list and then iterate over the list and fill the To: header with each recipient.
    The disadvantage is that you send an email for each recipient (creating more traffic). The other proposed solution sends one mail with all the recipients in Bcc.
    Yes, i know that. That would be a problem on the x10 server. Because you can send 100 mails each hour. I am at the moment keeping the Bcc & To as marshian said.
    My Website: mitch.exofire.net (currenly not really working on it ;))



+ Reply to Thread

Similar Threads

  1. Replies: 3
    Last Post: 12-10-2009, 08:47 PM
  2. ya no puedo enviar emails por php mail (Stoli)
    By palantir in forum Soporte
    Replies: 1
    Last Post: 10-29-2009, 07:55 PM
  3. funcion mail() de php
    By elfowan in forum Soporte
    Replies: 5
    Last Post: 10-07-2009, 01:03 PM
  4. mail() disabled w/ php v2
    By greenie in forum Free Hosting
    Replies: 1
    Last Post: 11-02-2007, 09:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers