|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-05-25 14:44 UTC] reeze dot xia at gmail dot com
[2012-05-25 14:47 UTC] danbrown@php.net
-Status: Open
+Status: Not a bug
[2012-05-25 14:47 UTC] danbrown@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 17:00:01 2025 UTC |
Description: ------------ Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() {got such error} Test script: --------------- <html><body> <h2>Aliens Abducted Me - Report an Abduction</h2> <?php $when_it_happened=$_POST['whenithappened']; $how_long=$_POST['howlong']; $how_many=$_POST['howmany']; $alien_description = $_POST['aliendescription']; $what_did=$_POST['whattheydid']; $fang_spotted = $_POST['fangspotted']; $email = $_POST['email']; $other=$_POST['other']; $name=$_POST['firstname'] .''. $_POST['lastname']; $to="pooja.kalantri@gmail.com"; $subject="Abducation Form"; $msg="$name you were abducted $when_it_happened and were gone for $how_long.\n". "Number of alien:$how_many\n". "describe Them:$alien_description\n". "The alien did this:$what_did\n". "Was Fang there? $fang_spotted\n". "I want to add $other"; mail($to,$msg, $subject ,"From:". $email); echo 'Thanks for submiitting form.<br>'; echo 'you were abuducted' . $when_it_happened; echo ' and were gone for ' . $how_long . '<br />'; echo 'Number of alien'. $how_many .'<br/>'; echo 'Describe them: ' . $alien_description . '<br />'; echo 'The alien did this:'. $what_did .'<br/>'; echo 'Was Fang there? ' . $fang_spotted . '<br />'; echo 'Your email address is ' . $email; echo 'I want to add' . $other .'<br/>'; echo 'I am'.$name; ?> </body></html> Expected result: ---------------- get the mail in inbox Actual result: -------------- Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()