user2738520
user2738520

Reputation: 1391

can anyone help me with mail function in php?

I'm new to php, i just start to use mail function. I have a problem like below:

Suppose, i have more recipients than one that will get my email.

<?php
    $to = $_POST['to'];  //[email protected],[email protected],[email protected]
    $from = $_POST['from'];  //[email protected]
    $from = "myinfo <$from>";
    $subject = $_POST['subject'];  //New campiagn
    $content = $_POST['content'];
    $headers = "From:" . $from;
    mail($to,$subject,$content,$headers);
?>

The code above work correctly. But when user get this email, they will see:

To Me, [email protected], [email protected]

I don't want all users that get this email show when user view this email. Below is what i want:

To [email protected]

Does it is possible to do like this? I'm appreciate to all of your answer :)

Thank in advance

Upvotes: 0

Views: 79

Answers (1)

user1864610
user1864610

Reputation:

If you use a list in the To: field of a regular mail client the list will appear to every recipient. This is normal behaviour. If you want to hide the list then your best option is to send each recipient their own individual copy.

Upvotes: 1

Related Questions