crmpicco
10-29-2007, 09:42 PM
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
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
<?
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″;
$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
However, I am currently getting an error as shown at:
http://www.ayrshireminis.com/email.php
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
<?
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″;
$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