PHP mail() hiding recipients

Mitch

New Member
Messages
908
Reaction score
0
Points
0
This is my script that i got:

PHP:
$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:

marshian

New Member
Messages
526
Reaction score
9
Points
0
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:

Mitch

New Member
Messages
908
Reaction score
0
Points
0
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:

marshian

New Member
Messages
526
Reaction score
9
Points
0
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.
 

Mitch

New Member
Messages
908
Reaction score
0
Points
0
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.
 

fortwienix

New Member
Messages
9
Reaction score
0
Points
0
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.
 

Mitch

New Member
Messages
908
Reaction score
0
Points
0
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.
 
Top