Page 1 of 1

sending email script

Posted: Sat Jan 02, 2010 1:27 am
by myasirm
hi guys i want to send email from my page i have taken this code as sample and i create mailform.php page as blank so when i click on submit button i am not getting any email in my email inbox kindly help me in this regards if any one know

thanks in anticipation.

<html>
<body>

<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
{
//send email
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail( "someone@example.com", "Subject: $subject",
$message, "From: $email" );
echo "Thank you for using our mail form";
}
else
//if "email" is not filled out, display the form
{
echo "<form method='post' action='mailform.php'>
Email: <input name='email' type='text' /><br />
Subject: <input name='subject' type='text' /><br />
Message:<br />
<textarea name='message' rows='15' cols='40'>
</textarea><br />
<input type='submit' />
</form>";
}
?>

</body>
</html>

Re: sending email script

Posted: Sat Jan 02, 2010 1:57 am
by myasirm
guys i am getting this warning massage



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() in C:\wamp\www\softwareComp\complain_msg.php on line 77
Thank you for using our mail form

Re: sending email script

Posted: Sat Jan 02, 2010 4:49 am
by myasirm
8O

Re: sending email script

Posted: Sat Jan 02, 2010 6:17 am
by myasirm
:?:

Re: sending email script

Posted: Sat Jan 02, 2010 7:30 am
by manojsemwal1
Check in your server smtp has configured or not.

Re: sending email script

Posted: Mon Jan 04, 2010 11:56 pm
by myasirm
dear from where i can check my smtp server and what changes are required to work this emailing program

kindly help me in this regards it is very important for me

thsnks

Re: sending email script

Posted: Tue Jan 05, 2010 12:31 am
by myasirm
?????

Re: sending email script

Posted: Tue Jan 05, 2010 1:58 am
by xiaolin
if you want to send email from your local host, you should config smtp. there is no error if you send mail from webhost.

Re: sending email script

Posted: Tue Jan 05, 2010 5:12 am
by myasirm
from where i config smtp server ?

Re: sending email script

Posted: Tue Jan 05, 2010 5:48 am
by manojsemwal1
which server u r using LAMP or WAMP for sending email your server has to be configured as mail server
if mail server is configured so open php.ini file and find smtp and put smtp server ip or port.

Re: sending email script

Posted: Tue Jan 05, 2010 6:38 am
by myasirm
yes im using WAMP kindly tell me what should i write in php.ini file?

Re: sending email script

Posted: Tue Jan 05, 2010 6:40 am
by myasirm
in php.ini file only two times smtp is written now kindly tell me what changes should i do????


;extension=php_smtp.dll


[mail function]
; For Win32 only.
SMTP = localhost

Re: sending email script

Posted: Tue Jan 05, 2010 6:48 am
by Ragnis
Remove the semicolon(;)

Code: Select all

extension=php_smtp.dll