santos Posted October 21, 2007 Share Posted October 21, 2007 i am sending an email using php. i dont want the receipeints to see the to address. the problem is i am sending to a mailing list email address. so how can i hide the to address and the from address if possible? thanks a lot for your help. Quote Link to comment https://forums.phpfreaks.com/topic/74167-solved-hiding-the-receipeint-email-address-while-sending-email/ Share on other sites More sharing options...
corillo181 Posted October 21, 2007 Share Posted October 21, 2007 what? your trying to hide who is sending the email or who is going to receive it? Quote Link to comment https://forums.phpfreaks.com/topic/74167-solved-hiding-the-receipeint-email-address-while-sending-email/#findComment-374563 Share on other sites More sharing options...
santos Posted October 21, 2007 Author Share Posted October 21, 2007 yes, i want to hide the receiver email address when it comes to my inbox, haven't you seen something like <recipients undisclosed> when we get some forwards,newsletter etc.. how can i do that in php??? Quote Link to comment https://forums.phpfreaks.com/topic/74167-solved-hiding-the-receipeint-email-address-while-sending-email/#findComment-374576 Share on other sites More sharing options...
corillo181 Posted October 21, 2007 Share Posted October 21, 2007 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 = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> as you can the th from is where you would put the mail. Quote Link to comment https://forums.phpfreaks.com/topic/74167-solved-hiding-the-receipeint-email-address-while-sending-email/#findComment-374589 Share on other sites More sharing options...
santos Posted October 21, 2007 Author Share Posted October 21, 2007 so even if i give a wrong To address in the header, it will reach the right receipient? Quote Link to comment https://forums.phpfreaks.com/topic/74167-solved-hiding-the-receipeint-email-address-while-sending-email/#findComment-374617 Share on other sites More sharing options...
steve448 Posted October 21, 2007 Share Posted October 21, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/74167-solved-hiding-the-receipeint-email-address-while-sending-email/#findComment-374637 Share on other sites More sharing options...
bozebo Posted October 21, 2007 Share Posted October 21, 2007 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@email.com','email@email.com','email@email.com','email@email.com'); $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); foreach($recipients as $to){ mail($to, $subject, $message, $headers); } Quote Link to comment https://forums.phpfreaks.com/topic/74167-solved-hiding-the-receipeint-email-address-while-sending-email/#findComment-374644 Share on other sites More sharing options...
santos Posted October 21, 2007 Author Share Posted October 21, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/74167-solved-hiding-the-receipeint-email-address-while-sending-email/#findComment-374726 Share on other sites More sharing options...
steve448 Posted October 21, 2007 Share Posted October 21, 2007 By adding the bcc to the headers There are plenty of examples on php.net Quote Link to comment https://forums.phpfreaks.com/topic/74167-solved-hiding-the-receipeint-email-address-while-sending-email/#findComment-374732 Share on other sites More sharing options...
santos Posted October 21, 2007 Author Share Posted October 21, 2007 yes, thanks bcc works, but how can i hide the sender email address. plss?? Quote Link to comment https://forums.phpfreaks.com/topic/74167-solved-hiding-the-receipeint-email-address-while-sending-email/#findComment-374769 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.