Administrator Currently Offline
|
Posts: 22
Join Date: Mar 2006
|
Yes it is possible. Just keep in mind that the mail function opens a new socket connection every time that a mail is sent. So you wouldn't want to approach sending with this method if mailing to a very large list for example - as it would simply drain a server in no time.
Here is a small sample of a working mail function that doesn't take any user input other than the variables embedded, or have any error checking etc.. :
Code:
<?php
$message = "Sending made up Larry some email!";
mail('larry@somesitesomewhere.com', 'Email For You', $message);
?>
You'll notice that by default the mail function contains three basic parameters - who it's to, the subject and the message. You can also send headers. Setting the headers is a good idea if you don't want replies sent to the mailing address, you want to declare a different content type(HTML), or you want to send copies to other addresses.
|