| | |
test PHP mail() in localhost
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
hi, i have a hard time testing my PHP mail() function in the localhost.
can you teach me? it's my first time to use this mail() function.
this is my PHP code in the file: contact.php
when i run it in the localhost, i got this error message:
how could i make the mail() function work?
can you teach me? it's my first time to use this mail() function.
this is my PHP code in the file: contact.php
PHP Syntax (Toggle Plain Text)
<?php $email_to = $_REQUEST['email_to']; $subject = "Re: FAQ Suggestion"; $email = "d26thletter@yahoo.com"; $message = $_REQUEST['message'] ; $headers = "From: $email"; $sent = mail($email_to, $subject, $message, $headers) ; if($sent) {print "Your mail was sent successfully"; } else {print "We encountered an error sending your mail"; } ?>
when i run it in the localhost, i got this error message:
PHP Syntax (Toggle Plain Text)
SMTP server response: 553 We do not relay non-local mail, sorry. in C:\xampp\htdocs\FAQ\contact.php on line 15 We encountered an error sending your mail
how could i make the mail() function work?
•
•
Join Date: Apr 2009
Posts: 37
Reputation:
Solved Threads: 2
its becoz an email server is nt configured on your local machine...It wil work fine when u upload the file to the server....
You'll have to use your isp's SMTP server.
See here:http://roshanbh.com.np/2007/12/sendi...vironment.html
See here:http://roshanbh.com.np/2007/12/sendi...vironment.html
Lost time is never found again.
- Benjamin Franklin
- Benjamin Franklin
•
•
Join Date: Mar 2008
Posts: 218
Reputation:
Solved Threads: 33
It depends on what OS you are running on.
Based off of the question, I'll assume you are running windows.
Buddylee17 had a great link.
On windows, I use stunnel that connects to sendmail http://www.google.com/search?q=php+s...ient=firefox-a
Based off of the question, I'll assume you are running windows.
Buddylee17 had a great link.
On windows, I use stunnel that connects to sendmail http://www.google.com/search?q=php+s...ient=firefox-a
•
•
Join Date: Mar 2009
Posts: 5
Reputation:
Solved Threads: 1
I agree with "shefeekj" you should configure your mail server. If you see Windows, I just wanna suggest you to follow these step using ArgoSoft:
http://www.phpeasystep.com/phptu/23.html
Good luck, buddy
http://www.phpeasystep.com/phptu/23.html
Good luck, buddy
•
•
Join Date: Apr 2009
Posts: 3
Reputation:
Solved Threads: 1
thingking........
http://stock4you.net
Free download psd files,psd templates, brushes, fonts, Styles, web templates
All for designer
Free download psd files,psd templates, brushes, fonts, Styles, web templates
All for designer
![]() |
Similar Threads
- How to setup php so I can use mail() function? (PHP)
- PLS I NEED YOUR HELP! Help on Reading and Editing of already Written CODE on php! (PHP)
- sending mail from home servers [localhost] (PHP)
- php syntax error (PHP)
- page1Form.php to page2Form.php (PHP)
- Mail settings in php.ini on Windows (PHP)
- Struggling with Captcha (PHP)
- PHP mail() (Sendmail) Problem :( (PHP)
Other Threads in the PHP Forum
- Previous Thread: arrays checkboxes, Form submit array
- Next Thread: MySQL and Apache
Views: 1655 | Replies: 6
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code codingproblem cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select send server sessions sms soap source space speed sql static structure syntax system table tutorial up-to-date update updates upload url validation validator variable video web wordpress xml youtube





