Jump to content

send email to two different accounts?


thewabbit1

Recommended Posts

Hey, im pretty new to the whole php thing. I am testing out a contact us form for a website. I have set it up for the info written in the feilds (name email address comment) to be sent to my email. But i was wondering if i could also send a conformation email to the email address that was entered in the email feild?

This is the code i have tried so far, with no luck:

 

<?php

$name  = $_POST ['name'];

$email = $_POST ['email'];

$address = $_POST['address'];

$comment = $_POST['comment'];

$newsletter = $_POST['newsletter'];

 

$content = "Hey \n $name wants to get in contact with you. Their comment was: \n $comment \n

$name can be contacted on $email and their address is $address. \n

Newsletter: $newsletter";

$from = "From: $email";

$clientcontent = "Hey $name \n Thank you for registering your interest in *********. We will get back to you as soon as possible. \n Thank you \n \n Your inquiry \n Name: $name \n Email: $email \n Address: $address \n Comment: $comment \n Newsletter: $newsletter" ;

$fromclient = "*****@*******.*******" ;

 

mail('*****@*******.*******', 'Inquiry from SportSmart website', $content, $from) ;

mail('$email', 'Inquiry from SportSmart website', $clientcontent, $fromclient) ;

 

?>

Link to comment
https://forums.phpfreaks.com/topic/200128-send-email-to-two-different-accounts/
Share on other sites

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.