Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 29th, 2007, 03:45 PM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
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
Reply With Quote
  #2 (permalink)  
Old October 29th, 2007, 06:06 PM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
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
Reply With Quote
  #3 (permalink)  
Old October 29th, 2007, 11:23 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oklahoma City, Oklahoma, USA.
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You might try http://phpmailer.sourceforge.net
Reply With Quote
  #4 (permalink)  
Old November 4th, 2007, 01:18 PM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:29 PM.


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