UPWORK/ODESK guru: Tips and Tricks for clients

skype: upwork.link , email: info@upwork.link

Testing of the mail function of PHP from shell on the server.

without comments

1. Download little script – http://it.sysnet.by/scripts/mail-test.script
 

<?php
$to = "info@sysnet.by";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "test@sysnet.by";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
printf("Mail Sent.\n");
?>

 
2. Open file and change variables $to and/or $from
3. Execute in shell:
 

sysnetb@sysnet.by [~/]# php mail-test.php
Mail Sent.
sysnetb@sysnet.by [~/]#

 
4. If you have correctly installed mail daemon, then you should get message.
If the mail message,that was sent from the form of site (PHP) still don’t accepted, then problem only in logic of the site.

 

Written by spectre

June 7th, 2012 at 4:49 pm

Posted in Tips and Tricks

Leave a Reply

*