Jump to content

Mail()l


webdevdea

Recommended Posts

Im working from this fun PHP sql book while I am out for a few weeks, I am working on an alien abduction form lol its supposed to mail it to me..
here is my code for that part.. can you tell me what I am doing wrong with it?
 

$to = '[email protected]';
   $subject = 'Aliens Abducted Me - Abduction Report';
   $msg = "$name was abducted $when_it_happened and was gone for $how_long.\n" .
    "Number of aliens: $how_many\n";
    "Alien Description: $alien_description\n";
    "What they did: $what_they_did\n";
    "Fang Spotted: $fang_spotted\n";
    "Other Comments: $other";
     mail($to, $subject, $msg, 'From:' . $email);
Link to comment
https://forums.phpfreaks.com/topic/280658-maill/
Share on other sites

Yeah I didnt look in my junk box, I thought it was not working, I apologize i am new to this just trying to work out some bugs lol .. 

are you running this from your local machine or from a web server. if you are running it from your local machine then you need to make sure your mail client is configured correctly

Link to comment
https://forums.phpfreaks.com/topic/280658-maill/#findComment-1442823
Share on other sites

Try to send this exampe from php.net:

<?php

$to      = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
    'Reply-To: [email protected]' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
Link to comment
https://forums.phpfreaks.com/topic/280658-maill/#findComment-1442863
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.