Installing Fake Sendmail for Windows: Difference between revisions
Installing Fake Sendmail for Windows (view source)
Revision as of 08:32, 24 November 2010
, 24 November 2010Reverted edits by Upazixorys (Talk); changed back to last version by BobS
Upazixorys (talk | contribs) No edit summary |
m (Reverted edits by Upazixorys (Talk); changed back to last version by BobS) |
||
Line 1: | Line 1: | ||
<span id="top"></span> | |||
<div style="padding:0;margin:0; border-bottom:3px inset #000000"> | |||
{| | {| | ||
| [[Image:uc_small_logo.gif | MPG UniCenter]] || | | [[Image:uc_small_logo.gif | MPG UniCenter]] || | ||
Line 7: | Line 6: | ||
[[Installing Fake Sendmail for Windows | Installing Fake Sendmail for Windows]] | [[Installing Fake Sendmail for Windows | Installing Fake Sendmail for Windows]] | ||
|} | |} | ||
</div> | |||
{| cellpadding= | {| cellpadding="4" | ||
| | | | ||
__TOC__ | __TOC__ | ||
Line 18: | Line 17: | ||
PHP’s mail function is extremely easy to use. On the [[PHP mail function | previous page (Solution 1)]] I have shown what modification are required to the '''php.ini''' file to get it to work with your host's SMTP server. However it '''fails''' if your host requires '''authentication'''. '''Fake sendmail for Windows''' to the rescue. | PHP’s mail function is extremely easy to use. On the [[PHP mail function | previous page (Solution 1)]] I have shown what modification are required to the '''php.ini''' file to get it to work with your host's SMTP server. However it '''fails''' if your host requires '''authentication'''. '''Fake sendmail for Windows''' to the rescue. | ||
Unix users take all this stuff for granted; it's there and they just send emails. When they try to set '''sendmail | Unix users take all this stuff for granted; it's there and they just send emails. When they try to set '''sendmail "-t"''' on Windows, it's not there, so what do you think they do? Yep, write something useful, like “fake sendmail” by '''Byron Jones''', and give it to the community. The latest software “fake sendmail for windows” can be found here '''[http://glob.com.au/sendmail/ glob.com.au]''' | ||
== Background == | == Background == | ||
Line 28: | Line 27: | ||
The above really is to dispel some misconceptions about the php.ini file: | The above really is to dispel some misconceptions about the php.ini file: | ||
{|cellpadding= | {|cellpadding="8" | ||
|-style= | |-style="background:#e4e4e4" | ||
!php.ini section [mail function] | !php.ini section [mail function] | ||
!Comments | !Comments | ||
|--style= | |--style="background:#f0f0f0" | ||
| | | | ||
[mail function] | [mail function]<br> | ||
<nowiki>;</nowiki> For Win32 only.<br> | |||
SMTP = '''localhost''' | SMTP = '''localhost'''<br> | ||
smtp_port = '''25''' | smtp_port = '''25''' | ||
<nowiki>;</nowiki> For Win32 only.<br> | |||
sendmail_from = me@localhost.com | sendmail_from = me@localhost.com | ||
<nowiki>;</nowiki>For Unix only. You may supply arguments as well (default: ;"sendmail -t -i").<br> | |||
<nowiki>;</nowiki>'''''sendmail_path = "/usr/bin/sendmail.exe -t'''''" | |||
<nowiki>;</nowiki> Force the addition of the specified parameters to be passed as extra parameters<br> | |||
<nowiki>;</nowiki> to the sendmail binary. These parameters will always replace the value of<br> | |||
<nowiki>;</nowiki> the 5th parameter to mail(), even in safe mode.<br> | |||
<nowiki>;</nowiki> mail.force_extra_paramaters = | |||
| | | | ||
These are defaults settings for php.ini. At a first glance you would think there are two separate sections, one specific to Windows and the other for Unix, in reality '''they are two options''' that you can use on Windows. | These are defaults settings for php.ini. At a first glance you would think there are two separate sections, one specific to Windows and the other for Unix, in reality '''they are two options''' that you can use on Windows. | ||
Line 63: | Line 62: | ||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' | ||
== Pre-Installation == | == Pre-Installation == | ||
{|cellpadding= | {|cellpadding="4" cellspacing="4" width="80%" | ||
|- | |- | ||
|valign= | |valign="top" style="background:#f3f3f3"| | ||
{|cellpadding= | {|cellpadding="2" style="background:#f3f3f3" | ||
|- | |- | ||
|valign= | |valign="top"| 1 ||'''A)''' Download the latest version of '''[http://glob.com.au/sendmail/ Fake sendmail for Windows]''' the current version is (23 Apr 24, 2008) Save the file to a temporary folder for example '''c:\sendmail_temp'''. | ||
|- | |- | ||
|valign= | |valign="top"| 2||'''B)''' Extract the file to the current folder ('''right click''' on '''sendmail.zi'''p and select Extract All... click '''Next''' and '''Next''' again) this creates a new folder named '''sendmail'''. | ||
|- | |- | ||
|valign= | |valign="top"| 3||'''C)''' Copy the folder '''sendmail''' and all its content from c:\'''sendmail_temp''' to the UniServer folder *Uniform Server\udrive\usr\'''local''' | ||
|- | |- | ||
|valign= | |valign="top"| 4||'''D)''' If you wish to save space delete the '''source''' folder | ||
|- | |- | ||
|valign= | |valign="top"| ||<br> | ||
'''''Note 1'':''' Contents of folder *Uniform Server\udrive\usr\local\sendmail | '''''Note 1'':''' Contents of folder *Uniform Server\udrive\usr\local\sendmail | ||
*license.txt | *license.txt | ||
Line 94: | Line 93: | ||
With '''Fake Sendmail''' in place we need to edit the php.ini file so PHP’s mail function can use it. | With '''Fake Sendmail''' in place we need to edit the php.ini file so PHP’s mail function can use it. | ||
Open the file '''php.ini''' located in folder '''*\Uniform Server\udrive\usr\local\php''' and search for this section | Open the file '''php.ini''' located in folder '''*\Uniform Server\udrive\usr\local\php''' and search for this section <nowiki>[</nowiki>'''mail function'''<nowiki>]</nowiki> (starts around line 612) | ||
{|cellpadding= | {|cellpadding="8" | ||
|-style= | |-style="background:#e4e4e4" | ||
!php.ini section [mail function] | !php.ini section [mail function] | ||
!Comments | !Comments | ||
|--style= | |--style="background:#f0f0f0" | ||
| | | | ||
[mail function] | [mail function]<br> | ||
<nowiki>;</nowiki> For Win32 only.<br> | |||
''' | '''<nowiki>;</nowiki>SMTP = localhost'''<br> | ||
''' | '''<nowiki>;</nowiki>smtp_port = 25''' | ||
<nowiki>;</nowiki> For Win32 only.<br> | |||
''';sendmail_from = me@localhost.com''' | ''';sendmail_from = me@localhost.com''' | ||
<nowiki>;</nowiki>For Unix only. You may supply arguments as well (default: ;"sendmail -t -i").<br> | |||
'''sendmail_path = | '''sendmail_path = "/usr/local/sendmail/sendmail.exe -t"''' | ||
<nowiki>;</nowiki> Force the addition of the specified parameters to be passed as extra parameters<br> | |||
<nowiki>;</nowiki> to the sendmail binary. These parameters will always replace the value of<br> | |||
<nowiki>;</nowiki> the 5th parameter to mail(), even in safe mode.<br> | |||
<nowiki>;</nowiki> mail.force_extra_paramaters = | |||
|valign= | |valign="top"| | ||
# '''Comment out''' the Win32 lines as shown by adding a | # '''Comment out''' the Win32 lines as shown by adding a "''';'''" to the beginning of each line.<br><br> | ||
# '''Enable''' the sendmail_path by removing the | # '''Enable''' the sendmail_path by removing the "''';'''" at the begining of the line.<br><br> | ||
# Replace the path: | # Replace the path:<br>'''/usr/bin/sendmail.exe -t'''<br> '''''with'''''<br>'''/usr/local/sendmail/sendmail.exe''' as shown. | ||
|} | |} | ||
Line 130: | Line 129: | ||
Below I have listed three possible configurations. The first is really a reference; it does not use authentication and produces a similar result to the solution outlined on the previous page. To make it easier to read I have removed all comments. | Below I have listed three possible configurations. The first is really a reference; it does not use authentication and produces a similar result to the solution outlined on the previous page. To make it easier to read I have removed all comments. | ||
{|cellpadding= | {|cellpadding="4" | ||
|-style= | |-style="background:#e4e4e4" | ||
!Similar to previous page | !Similar to previous page | ||
!SMTP + Authentication | !SMTP + Authentication | ||
!SMTP + POP before Authentication | !SMTP + POP before Authentication | ||
|-style= | |-style="background:#f0f0f0" | ||
|[sendmail]||[sendmail]||[sendmail] | |[sendmail]||[sendmail]||[sendmail] | ||
|-style= | |-style="background:#f0f0f0" | ||
|smtp_server=smtp.yourdomain.com||smtp_server=smtp.yourdomain.com||smtp_server=smtp.yourdomain.com | |smtp_server=smtp.yourdomain.com||smtp_server=smtp.yourdomain.com||smtp_server=smtp.yourdomain.com | ||
|-style= | |-style="background:#f0f0f0" | ||
|smtp_port=25||smtp_port=25||smtp_port=25 | |smtp_port=25||smtp_port=25||smtp_port=25 | ||
|-style= | |-style="background:#f0f0f0" | ||
|default_domain=yourdomain.com||default_domain=yourdomain.com||default_domain=yourdomain.com | |default_domain=yourdomain.com||default_domain=yourdomain.com||default_domain=yourdomain.com | ||
|-style= | |-style="background:#f0f0f0" | ||
|;error_logfile=error.log||;error_logfile=error.log||;error_logfile=error.log | |;error_logfile=error.log||;error_logfile=error.log||;error_logfile=error.log | ||
|-style= | |-style="background:#f0f0f0" | ||
|;debug_logfile=debug.log||;debug_logfile=debug.log||;debug_logfile=debug.log | |;debug_logfile=debug.log||;debug_logfile=debug.log||;debug_logfile=debug.log | ||
|-style= | |-style="background:#f0f0f0" | ||
|;auth_username=||auth_username=you@yourdomain.com||;auth_username= | |;auth_username=||auth_username=you@yourdomain.com||;auth_username= | ||
|-style= | |-style="background:#f0f0f0" | ||
|;auth_password=||auth_password=mysecretpassword||;auth_password= | |;auth_password=||auth_password=mysecretpassword||;auth_password= | ||
|-style= | |-style="background:#f0f0f0" | ||
|;pop3_server=||;pop3_server=||pop3_server=pop.yourdomain.com | |;pop3_server=||;pop3_server=||pop3_server=pop.yourdomain.com | ||
|-style= | |-style="background:#f0f0f0" | ||
|;pop3_username=||;pop3_username=||pop3_username=you@yourdomain.com | |;pop3_username=||;pop3_username=||pop3_username=you@yourdomain.com | ||
|-style= | |-style="background:#f0f0f0" | ||
|;pop3_password= ||;pop3_password=||pop3_password=mysecretpassword | |;pop3_password= ||;pop3_password=||pop3_password=mysecretpassword | ||
|-style= | |-style="background:#f0f0f0" | ||
|force_sender=you@yourdomain.com||force_sender=you@yourdomain.com||force_sender=you@yourdomain.com | |force_sender=you@yourdomain.com||force_sender=you@yourdomain.com||force_sender=you@yourdomain.com | ||
|-style= | |-style="background:#f0f0f0" | ||
|;hostname=||;hostname=||;hostname= | |;hostname=||;hostname=||;hostname= | ||
|} | |} | ||
Line 166: | Line 165: | ||
For example if this was the information provide by my ISP: | For example if this was the information provide by my ISP: | ||
{|style= | {|style="background:#000000" cellspacing="1" cellpadding="4" | ||
|-style= | |-style="background:#f0f0f0" | ||
|SMTP Server||'''smtp.xip.com''' | |SMTP Server||'''smtp.xip.com''' | ||
|-style= | |-style="background:#f0f0f0" | ||
|POP Server||'''pop.xip.com''' | |POP Server||'''pop.xip.com''' | ||
|-style= | |-style="background:#f0f0f0" | ||
|Email address||'''fred123@xip.com''' | |Email address||'''fred123@xip.com''' | ||
|-style= | |-style="background:#f0f0f0" | ||
|Account password||'''me456''' | |Account password||'''me456''' | ||
|} | |} | ||
Line 179: | Line 178: | ||
The above table would look like this: | The above table would look like this: | ||
{|cellpadding= | {|cellpadding="4" | ||
|-style= | |-style="background:#e4e4e4" | ||
!Similar to previous page | !Similar to previous page | ||
!SMTP + Authentication | !SMTP + Authentication | ||
!SMTP + POP before Authentication | !SMTP + POP before Authentication | ||
|-style= | |-style="background:#f0f0f0" | ||
|[sendmail]||[sendmail]||[sendmail] | |[sendmail]||[sendmail]||[sendmail] | ||
|-style= | |-style="background:#f0f0f0" | ||
|smtp_server='''smtp.xip.com'''||smtp_server='''smtp.xip.com'''||smtp_server='''smtp.xip.com''' | |smtp_server='''smtp.xip.com'''||smtp_server='''smtp.xip.com'''||smtp_server='''smtp.xip.com''' | ||
|-style= | |-style="background:#f0f0f0" | ||
|smtp_port=25||smtp_port=25||smtp_port=25 | |smtp_port=25||smtp_port=25||smtp_port=25 | ||
|-style= | |-style="background:#f0f0f0" | ||
|default_domain='''xip.com'''||default_domain='''xip.com'''||default_domain='''xip.com''' | |default_domain='''xip.com'''||default_domain='''xip.com'''||default_domain='''xip.com''' | ||
|-style= | |-style="background:#f0f0f0" | ||
|;error_logfile=error.log||;error_logfile=error.log||;error_logfile=error.log | |;error_logfile=error.log||;error_logfile=error.log||;error_logfile=error.log | ||
|-style= | |-style="background:#f0f0f0" | ||
|;debug_logfile=debug.log||;debug_logfile=debug.log||;debug_logfile=debug.log | |;debug_logfile=debug.log||;debug_logfile=debug.log||;debug_logfile=debug.log | ||
|-style= | |-style="background:#f0f0f0" | ||
|;auth_username=||auth_username='''fred123@xip.com'''||;auth_username= | |;auth_username=||auth_username='''fred123@xip.com'''||;auth_username= | ||
|-style= | |-style="background:#f0f0f0" | ||
|;auth_password=||auth_password='''me456'''||;auth_password= | |;auth_password=||auth_password='''me456'''||;auth_password= | ||
|-style= | |-style="background:#f0f0f0" | ||
|;pop3_server=||;pop3_server=||pop3_server='''pop.xip.com''' | |;pop3_server=||;pop3_server=||pop3_server='''pop.xip.com''' | ||
|-style= | |-style="background:#f0f0f0" | ||
|;pop3_username=||;pop3_username=||pop3_username=fred123@xip.com | |;pop3_username=||;pop3_username=||pop3_username=fred123@xip.com | ||
|-style= | |-style="background:#f0f0f0" | ||
|;pop3_password= ||;pop3_password=||pop3_password=me456 | |;pop3_password= ||;pop3_password=||pop3_password=me456 | ||
|-style= | |-style="background:#f0f0f0" | ||
|force_sender='''fred123@xip.com'''||force_sender='''fred123@xip.com'''||force_sender='''fred123@xip.com''' | |force_sender='''fred123@xip.com'''||force_sender='''fred123@xip.com'''||force_sender='''fred123@xip.com''' | ||
|-style= | |-style="background:#f0f0f0" | ||
|;hostname=||;hostname=||;hostname= | |;hostname=||;hostname=||;hostname= | ||
|} | |} | ||
Line 218: | Line 217: | ||
'''''Test1'':''' | '''''Test1'':''' | ||
Start Uniform Server and type the following into your browser address bar: ''' | Start Uniform Server and type the following into your browser address bar: '''<nowiki>http://localhost/mail.html</nowiki>''' | ||
There is no need to enter any data into the text boxes. Just click on '''Send''' and you will receive this message: | There is no need to enter any data into the text boxes. Just click on '''Send''' and you will receive this message: | ||
Line 231: | Line 230: | ||
To check whether your ISP relays to other SMTP servers, send an email to a friend or to another account you own. Make sure your ISP hosts neither. | To check whether your ISP relays to other SMTP servers, send an email to a friend or to another account you own. Make sure your ISP hosts neither. | ||
Run the test page ( | Run the test page (<nowiki>http://localhost/mail.html</nowiki>). This time you will need to fill in the text boxes. | ||
Confirm that the emails are received. That completes the tests. | Confirm that the emails are received. That completes the tests. | ||