Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PHP Form - Problem with reply e-mail
- <?php
- // Get Data
- $name = strip_tags($_POST['name']);
- $email = strip_tags($_POST['email']);
- $message = strip_tags($_POST['message']);
- // Send Message
- mail( "Message from $name",
- "Name: $namenEmail: $emailnMessage: $messagen",
- "From: $name <forms@example.net>" );
- ?>
- // Send Message
- mail($to_address, "Message from $name",
- // Message
- "Name: $namenEmail: $emailnMessage: $messagen",
- // Additional headers
- "From: $name <forms@example.net>rnReply-to: reply@example.com"
- );
- bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
- mail( $to,
- $subject,
- $message,
- "From: $name <forms@example.net>" );
- <?php
- //define the receiver of the email
- $to = 'youraddress@example.com';
- //define the subject of the email
- $subject = 'Test email';
- //define the message to be sent. Each line should be separated with n
- $message = "Hello World!nnThis is my first mail.";
- //define the headers we want passed. Note that they are separated with rn
- $headers = "From: webmaster@example.comrnReply-To: webmaster@example.com";
- //send the email
- $mail_sent = @mail( $to, $subject, $message, $headers );
- //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
- echo $mail_sent ? "Mail sent" : "Mail failed";
- ?>
Add Comment
Please, Sign In to add comment