Send mail using PHP

Script last updated on December 4, 2006 2:25pm by !nucleo.

Pretty self explanatory. Mail() takes four arguments; Recipient, Subject, Body, Header info. For header info I just use from. The syntax is HEADER-ITEM: value. And in the case of the from header item you can put the persons name first and the email second in angle brackets.

<?
    if (!empty($_POST)) {
        $to = "nucleocide@gmail.com";
        $subject = htmlentities($_POST['about']);
        $body = htmlentities($_POST['comment']);
        $from = htmlentities($_POST['email']);
        if (mail($to, $subject, $body, "From: $name <$from>")) {
            echo("<p>Message has been sent!</p>");
        } else {
            echo("<p>Message delivery failed...</p>");
        }


    } else {
    ?>
<p>If you would like to ask us any questions,
request a quote, or send us any other message
this is the place to do so. Please allow one to two
business days for a response.</p>
<br />
<form action="?s=contact" method="post">
<input name="name" value="name" class="full" /><br />
<input name="email" value="email" class="full" /><br />
<select name="about" class="full">
<option value="Question">Question</option>
<option value="Quote Request" />Quote Request</option>
<option value="Other" />Other</option>
</select>
<textarea id="text" name="comment" class="full">Message</textarea>
<input type="submit" value="Send" />
</form>
<? } ?>

Login

Username:
Password:

Shoutbox

By !nucleo
Jun 12, 2008 7:56pm
About time you're back... Shoot me an email with your 88x31.
By ?Lee
Jun 12, 2008 3:27pm
vimixx.net has moved to lee-stewart.co.uk!!!
By ?Medvedko
May 4, 2008 7:04am
That's right. Sorry, I am not making much sense, am I? Basically, I created the DB myself instead of using your install script. All necessary tables are there, I added few more based on plugin POST options and added those to the update.php also. At the beginning I added mysql.ssi.php function to both update and winamp_playing scripts as I had some troubles before with include_once.
By !nucleo
May 2, 2008 9:56am
Now I'm really confused, are you modifying my shoutbox script?
By ?Medvedko
Apr 30, 2008 1:08am
another thing is that update script terminates with invalid password (I added the pass in the Additional Options in the plugin and set the pass in the update script.
By ?Medvedko
Apr 30, 2008 1:06am
my fault really. I modded the scripts and added more tables to the DB such as "TIMESTAMP". I think include_once doesn't fetch the mysql function. Or atleast this is what seems to me is the problem.
Name: Shout: This Number: [View All]

Partners

Rand Affiliates

Homework Inspiration ssope Photoshop Lab Andreas on the Web