SMTP with PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
larrytech
Forum Commoner
Posts: 35
Joined: Thu Jun 06, 2002 8:27 am

SMTP with PHP

Post by larrytech »

Hello,
I use apache with sendmail at the moment, but it is limited to 20 sends in one go. I am trying to do a newsletter, and am wondering if it is possible to use the mail() function but send through an smtp server. I don't have access to php.ini, so I am hoping it can be done on the page itself.
Does anyone have any ideas?
Larry
Wandrer
Forum Newbie
Posts: 21
Joined: Thu Jun 06, 2002 8:43 am

Post by Wandrer »

SMTP Class is a PHP class to enable you to send email direct through an smtp server. Currently supports all basic commands; HELO, EHLO, MAIL, RCPT, DATA. Also supports the AUTH LOGIN (basic authentication).

http://www.hotscripts.com/Detailed/12246.html
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

Just try using the mail() function in a php script

<?
$Success = mail("to@someone.com", "My Subject", "My Message");

if ($Success){
print "It Works!!!";
}
else{
print "Oops!!";
}

?>

If it works then you don't need to do anything else.

Mike
nagi
Forum Newbie
Posts: 1
Joined: Thu Jun 06, 2002 12:39 pm

mail() doesn't work, pl. help;

Post by nagi »

I'm using
mail("me@here.us","stuff","whatever");
in a .php page and am running IIS on Windows2000Professional.
I get
"Server Error in C:..\..\mail.php on line nn"

What am I doing wrong?

TIA
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Is the SMTP server set correctly in the php.ini file?

Mac
larrytech
Forum Commoner
Posts: 35
Joined: Thu Jun 06, 2002 8:27 am

Post by larrytech »

Thanks for this. I have downloaded the file from the link and will try it soon. I can already use mail(), but if more than 20 messages are sent in 10mins (i think) it disables for 24 hours. So SMTP is a better path.
Thanks!
Larry
Post Reply