Jump to content

[SOLVED] hiding the receipeint email address while sending email


santos

Recommended Posts

if you go to php.net and search the mail function you will see that the fourth parameter is the one where you include the mail that you put in it. so you can put anything you want.

<?php
//PHP.NET
$to      = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" . 
    'Reply-To: [email protected]' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?> 

 

as you can the th from is where you would put the mail.

No.

 

If you want to hide who is receiving the email then you can't because obviously the person receiving it knows what their email address is and if you don't tell it where to go it can't get there.

 

If you want to send the email to more than one person but don't want the recipients to know who else has received it then you can use BCC

 

If you want to make it so when someone forwards your message it removes the original recipients email address then I would assume that this is down to the mail client of the person forwarding the email, I doubt that you can control this part because it is no longer you sending the email. (Someone feel free to say otherwise if this is not correct).

 

There may be an instruction you can put in the headers for this but I have never heard of it, and it would only be an instruction anyway, the recipients mail client may do as it likes anyway.

 

You can hide who is sending the message by putting whatever you like in the FROM header, but the chances are it will just go straight to the SPAM folder if the FROM field does not relate to the server sending the email.

you need to loop through all recipients and send individual emails each time (your webhost may not like this)

 

as an example:

$recipients = array('[email protected]','[email protected]','[email protected]','[email protected]');
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" . 
    'Reply-To: [email protected]' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

foreach($recipients as $to){
mail($to, $subject, $message, $headers);
}

see, i need to sent the mail to a mailing list, thats the to address will be the mailing list email address.

now i dont want the receipient to see the mailing list address, as this makes them to send emails using the to address as this.

also the from address will be of the moderator, i wanna hide this also...

 

how can i do bcc

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.