| | |
php mailing not working. any help me?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2008
Posts: 10
Reputation:
Solved Threads: 0
php mailing not working. any help me?
i used the code to send mail is as follows:
<?php
$to = "someone@example.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
when i am executing i am getting following error:
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:\Program Files\xampp\htdocs\samplemuthu\file.php on line 7
i used the code to send mail is as follows:
<?php
$to = "someone@example.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
when i am executing i am getting following error:
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:\Program Files\xampp\htdocs\samplemuthu\file.php on line 7
•
•
Join Date: Dec 2007
Posts: 252
Reputation:
Solved Threads: 27
it doesnt look like your mailserver settings are correct in your php.ini file. this article will help you with this setup.
http://www.sitepoint.com/article/advanced-email-php
http://www.sitepoint.com/article/advanced-email-php
Hi,
- Search your computer for the 'php.ini' file....
- Once you have found it's location, open it using Notepad.exe
- Click Edit - Find and enter [mail function] now search for it within the document
- You should find this:
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =sendmail -t -i
The man who in view of gain thinks of righteousness; who in the view of danger is prepared to give up his life; and who does not forget an old agreement however far back it extends - such a man may be reckoned a complete man.
~ Confucius, The Confucian Analects
~ Confucius, The Confucian Analects
•
•
Join Date: May 2008
Posts: 19
Reputation:
Solved Threads: 1
Hi,You can use sleep() function just after mail($to,$subject,$message,$headers);
like this
mail($to,$subject,$message,$headers);
sleep(5);
may be it will works.
like this
mail($to,$subject,$message,$headers);
sleep(5);
may be it will works.
•
•
•
•
php mailing not working. any help me?
i used the code to send mail is as follows:
<?php
$to = "someone@example.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
when i am executing i am getting following error:
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:\Program Files\xampp\htdocs\samplemuthu\file.php on line 7
![]() |
Similar Threads
- php mailto () fuction (PHP)
- mailing error html code also sent with contant (PHP)
- PHP mail question (PHP)
- Newbie php question. how to create a mailing list? (MySQL)
- Need help with php mailing list/redirect (PHP)
- Bounced emails in mailing list? (Existing Scripts)
- PHP Form mailing troubles (PHP)
- vBulletin Email notifications not working (PHP)
Other Threads in the PHP Forum
- Previous Thread: PHP data retrieval from SQL problem
- Next Thread: Is there anyway to include a vb application in a web page
| Thread Tools | Search this Thread |
ajax apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link list login mail mediawiki menu mlm multiple mycodeisbad mysql number oop paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search seo server sessions sms soap source sp space speed sql subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign websphere white xml youtube





