I am looking to send email in my script and go through my mail account with my host (Turtle Hosting).
However, I am currently getting an error as shown at:
http://www.ayrshireminis.com/email.php
Code:
Warning: main(Mail.php) [function.main]: failed to open stream: No such file or directory in /home/ayrshire/public_html/email.php on line 2
Fatal error: main() [function.require]: Failed opening required 'Mail.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ayrshire/public_html/email.php on line 2
PHP Code:
<?
include(âMail.phpâ);
/* mail setup recipients, subject etc */
$recipients = âfeedback@yourdot.comâ;
$headers[âFromâ] = âuser@somewhere.comâ;
$headers[âToâ] = âfeedback@yourdot.comâ;
$headers[âSubjectâ] = âUser feedbackâ;
$mailmsg = âHello, This is a test.â;
/* SMTP server name, port, user/passwd */
$smtpinfo[âhostâ] = âsmtp.mycorp.comâ;
$smtpinfo[âportâ] = â25#8243;;
$smtpinfo[âauthâ] = true;
$smtpinfo[âusernameâ] = âsmtpusernameâ;
$smtpinfo[âpasswordâ] = âsmtpPasswordâ;
/* Create the mail object using the Mail::factory method */
$mail_object =& Mail::factory(âsmtpâ, $smtpinfo);
/* Ok send mail */
$mail_object->send($recipients, $headers, $mailmsg);
?>
I know my host supports PHP PEAR, I have a ".pearrc" file in my root directory and also a PEAR Installer - however, there doesn't appear to be anything mentioning Email.
Cheers,
Picco
www.crmpicco.co.uk
www.ie7.com