Author Topic: Error solution for sending Emails by SMTP with Windows 2003 Server, php, MySQL  (Read 8951 times)

0 Members and 1 Guest are viewing this topic.

Offline per4mance

  • Newbie
  • *
  • Posts: 10
    • View Profile
Hi everybody,
I tested '4images' and had problems sending Emails with my own Email-Server. So I deativated 'SMTP' in the CP of '4images'. But all the time I got errors by sending eCards. I use php5 and MySQL 4.1 on a Windows 2003 server. Because of the security environment of Windows it was not possible to send the emails.

I found a very useful article for sending Emails on server above, please look at: http://www.ruhanirabin.com/php-sendmail-setup-with-smtp-iis-and-windows-servers/

What I did:
1. I checked on Wondows 2003 Server | Control Panel | Add/Remove Windows components | Application Server | Details | IIS | Details | SMTP Service is installed.
2. I checked my 'php.ini' in PHP5 folder if the following entry is correct:
Code: [Select]
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
3. I followed point '5  - Configure IIS SMTP Relay Restrictions' of the above link
4. I tested my own php file 'email_test.php' again and it works. Now I can send Emails without any problems on Windows 2003 Server.

Interested in creating your own 'email_text.php' ? Very simple to do this. Creat a txt file and rename it to 'email_test.php'. Open the file with any text editor and copy the following code:
Code: [Select]
<?php
if(mail('anyemail@anydomain.com','test subject','test message')){
      echo(
'ok');
    }
else{
      echo(
'not ok');
    }
?>
Save and upload the file by any FTP program to your root server and open in your browser 'http://www.yourdomain.tld/email_test.php'. If the answer is 'ok' everything works good. If not please read the article carefully.

I hope that my topic will be useful for a lot of user working wirth 4images Gallery.

Bye, Thorsten