Page 1 of 1
Sending mail with php
Posted: Mon Jan 27, 2003 5:22 pm
by nigma
Hey, I checked out the manual for php at php.net and I was able to read a little on the mail() function. I got everything configed to use proper port and the smtp server. But I could not find out on that page how to actually send mail. Could anyone give me example of what sending to variables would look like?
Posted: Mon Jan 27, 2003 8:28 pm
by volka
there are examples at
http://www.php.net/manual/en/function.m ... te]Example 1. Sending mail.
mail("
joecool@example.com", "My Subject", "Line 1\nLine 2\nLine 3");[/quote]
Posted: Tue Jan 28, 2003 2:28 am
by oldtimer
I use something similar to below.
Code: Select all
<?php
// email person
$recipient = $email; // this can come from many places. For me it comes from the persons account. You can also just type in the email address as well. Adding comas between the address will allow you more. Sometimes I will have a hidden value with the email address' typed in already.
$subject = "Your subject;
$message = "Thank you for viewing my online documents for Php and Mysql. If you would like to see something up here then please ask me.";
$extra = "From: you@yourdomain";
mail ($recipient,$subject,$message,$extra);
?>