| | |
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: 192
Reputation:
Solved Threads: 25
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
| Thread Tools | Search this Thread |
.htaccess action ajax apache api array auto beginner binary bounce broken cakephp checkbox class cms code cron curl database date display dynamic echo email error errorlog file files folder form format forms function functions google href htaccess html image include insert integration interactive ip java javascript joomla limit link login loop mail malfunctioning masterthesis menu mlm mod_rewrite multiple mysql nodes oop paypal pdf php popup problem query radio ram random recursion reference regex remote return script search server sessions sms soap source space sql syntax system table tutorial unset update upload url validation validator variable video web websitecontactform xml youtube





