| | |
PHP email script incomplete for windows and does not send
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Nov 2009
Posts: 2
Reputation:
Solved Threads: 0
Hi Everyone, i am really new at this and slowly getting started, to fast track my website i purchased a web template in flash with a php email script.
I have tried searching the web for a solution but i am not up o scratch with any code that makes sense to me. My problem i was given a very short script in php which functions from within the flash template, i cant change the inner (minimal) workings but i need to add extra code to strip slashes, connect and send through my windows hosting and any other security tips any one can help with.
I hope some one can help as i truly have no idea. I am not sure what i need to do and where to do it, anyway the code is pasted below, hope you can help.
I have tried searching the web for a solution but i am not up o scratch with any code that makes sense to me. My problem i was given a very short script in php which functions from within the flash template, i cant change the inner (minimal) workings but i need to add extra code to strip slashes, connect and send through my windows hosting and any other security tips any one can help with.
I hope some one can help as i truly have no idea. I am not sure what i need to do and where to do it, anyway the code is pasted below, hope you can help.
PHP Syntax (Toggle Plain Text)
<? $to = "email@domain.com"; $msg = "$name\n\n"; $msg .= "$message\n\n"; mail($to, $msg, "From: My web site\nReply-To: $email\n"); ?>
0
#2 Nov 9th, 2009
The function you are trying to use works with sendmail, which is a mail server for unix-like systems. In unix/linux/bsd/solaris/uix and so on it is found I believe under /usr/sbin/sendmail.
Unfortunately, in Windows, sendmail does not exist. Therefore, when PHP is looking to find sendmail in Windows, it simply cannot (in your php.ini there are some variables like SMTP, Sendmail_Path etc. As I said before, "sendmail_path" for unix machines =/usr/sbin/sendmail.)
A simple way to go around this, is to use an online SMTP server which you have access on (not gmail or hotmail I'm afraid, has to be some commercial SMTP server I think, one that you pay for), and use the SMTP and port variables to configure that.
If you absolutely need to send email from your windows machine, then you must install an smtp server. There are many good ones out there, I'd recommend Fake Sendmail, which is like the unix sendmail but configured to work under windows.
After you install your mail server, define the path to its executable from your php.ini, as said before under "Sendmail_Path". Also, you will have to do some configuring from the mail server so you enable it to send emails.
Hope this helps!
Unfortunately, in Windows, sendmail does not exist. Therefore, when PHP is looking to find sendmail in Windows, it simply cannot (in your php.ini there are some variables like SMTP, Sendmail_Path etc. As I said before, "sendmail_path" for unix machines =/usr/sbin/sendmail.)
A simple way to go around this, is to use an online SMTP server which you have access on (not gmail or hotmail I'm afraid, has to be some commercial SMTP server I think, one that you pay for), and use the SMTP and port variables to configure that.
If you absolutely need to send email from your windows machine, then you must install an smtp server. There are many good ones out there, I'd recommend Fake Sendmail, which is like the unix sendmail but configured to work under windows.
After you install your mail server, define the path to its executable from your php.ini, as said before under "Sendmail_Path". Also, you will have to do some configuring from the mail server so you enable it to send emails.
Hope this helps!
I take your reality and substitute my own
violarisgeorge.com
violarisgeorge.com
0
#4 Nov 9th, 2009
•
•
•
•
WOW, thanks for the quick reply, thats awesome. Actually i have email and an smtp server with my hosting,
Do you know where i can get script generated given that i have 4 or so fields that need to remain compulsory.
As always help is greatly appreciated.
The easiest way, would be to call up your hosting company and ask them if they can edit your php.ini configuration file so you can send mail with the email account you have with them.
I take your reality and substitute my own
violarisgeorge.com
violarisgeorge.com
![]() |
Similar Threads
- Adding Attachments to PHP Email program (PHP)
- send email script (PHP)
- PHP / Flash Variable Email Script Format Question (PHP)
- php email script sends text formatting (PHP)
- Need help with email script (Existing Scripts)
- My Array variable in PHP not supporting. (PHP)
- Generate Email script (PHP)
- Learning PHP but problem with script (PHP)
- Error message when running ASP email script (ASP)
Other Threads in the PHP Forum
- Previous Thread: complex sql database search using php code
- Next Thread: php inside php not working
Views: 328 | Replies: 3
| 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 jquery limit link login loop mail 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





