View Full Version : sending email with SMTP authentication (on port 26)

10-29-2007, 10: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:

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

/* 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.


10-30-2007, 01:06 AM
if there is any other way to send an email with PHP through a server that requires authentication (through port 26) then that would be good too?