Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 29th, 2007, 03:45 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default sending email with SMTP authentication (port 26)

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 â€œHelloThis 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
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
 
Old October 29th, 2007, 06:06 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

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?

www.crmpicco.co.uk
www.ie7.com
 
Old October 29th, 2007, 11:23 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You might try http://phpmailer.sourceforge.net
 
Old November 4th, 2007, 01:18 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

Thanks harpua, but I was recommended to try this one out:
http://www.swiftmailer.org/

I have to recommend it 100% as it worked great for me, could specify the port and everything else I needed.

Superb!!

www.crmpicco.co.uk
www.ie7.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem sending email with SMTP in VB.Net Compiler Forum and Wrox.com Feedback 3 November 30th, 2007 07:25 PM
SMTP Authentication and mail() lemonadeX Pro PHP 1 July 31st, 2007 10:06 AM
Sending email problem - SMTP server response: 554 Havokx Beginning PHP 0 July 27th, 2007 04:04 AM
Sending EMail thru SMTP server in C# - Most of the peri C# 1 December 20th, 2004 09:33 PM
mail() is not sending email on localhost SMTP anshul PHP How-To 5 August 4th, 2004 06:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.