sending email script
Moderator: General Moderators
sending email script
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>
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
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
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
-
manojsemwal1
- Forum Contributor
- Posts: 217
- Joined: Mon Jun 29, 2009 4:13 am
- Location: India
Re: sending email script
Check in your server smtp has configured or not.
Re: sending email script
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
kindly help me in this regards it is very important for me
thsnks
Re: sending email script
?????
Re: sending email script
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
from where i config smtp server ?
-
manojsemwal1
- Forum Contributor
- Posts: 217
- Joined: Mon Jun 29, 2009 4:13 am
- Location: India
Re: sending email script
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.
if mail server is configured so open php.ini file and find smtp and put smtp server ip or port.
Re: sending email script
yes im using WAMP kindly tell me what should i write in php.ini file?
Re: sending email script
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
;extension=php_smtp.dll
[mail function]
; For Win32 only.
SMTP = localhost
- Ragnis
- Forum Commoner
- Posts: 31
- Joined: Thu Nov 13, 2008 12:35 pm
- Location: Saaremaa, Estonia, Europe, Asia, Planet Earth, The Solar System, Milky way.
Re: sending email script
Remove the semicolon(;)
Code: Select all
extension=php_smtp.dll