samedi 30 août 2014

Sending mail on upload with network solutions hosting


Vote count:

0




I have a web page that allows someone to upload a file. I would like then to send an email. This is hosted on Network Solutions. The page in a the htdocs/aload directory along with this php file.



<?php
if (isset($_FILES['myFile'])) {
move_uploaded_file($_FILES['myFile']['tmp_name'], "auploads/" . $_FILES['myFile']['name']);
echo 'successful';

exec('php ../../cgi-bin/mailsend.php');

}
?>


The file upload works. The mail is never sent. I have been told that the mail file should reside in the cgi-bin directory,


this is the mailsend.php



<?php
echo 'in mail';
$to = 'info@example.com';
$subject = 'file received';
$message = 'test message';
$headers = 'From: info@example.com' . "\r\n" .
'Reply-To: info@avivonet.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
}
?>


The echo is not displayed, and the email not sent.


Can the mailsend.php be in the same directory as the web page? Is there something wrong in the mailsend.php?



asked 29 secs ago

Tori

478






Sending mail on upload with network solutions hosting

Aucun commentaire:

Enregistrer un commentaire