Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

SMTP e-mail in PHP

Aloittaja Mastiff, elokuu 28, 2007, 08:54:44 IP

« edellinen - seuraava »

Mastiff

Hey, can someone point me in the right direction for sending SMTP e-mail from a PHP script.  I had it working using a package I found called "phpmailer", but it suddenly stopped working.  I don't know why.  But my SMF install is still sending E-mails.

So what's the trick?  I traced some of the source PHP files in SMF and see they are using a function sendmail(), but this must be something written for SMF, right?  Since in my options I selected to use SMTP.  I can't find the actual function.

Any advice would be great, I'm kind of frustrated.
"If you're an ugly chick, you're basically the same as a dude... I mean, you're gonna have to work."

margarett

It could be that your host does not allow php mail function, that's why you are using SMTP in SMF...

You usually can send mail with something like:

$dest_mail = "[email protected]";
$from_mail = "[email protected]
$subject = "Your subject";

$text = "your text here";

mail("$mail_dest","$subject","$text","From: $from_mail");


We use this kind of script in our page and it works OK.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Mastiff

Thanks.  yeah, I decided to go that route.  For some reason I had it in my head that my ISP wouldn't let me use plain old mail().  I was also confused about how to get the "from" name correct, but as you show, it goes in the $header spot (also, e.g. "Bob Jones <[email protected]>").

I still wish I knew why my SMTP worked and then stopped working.  I wonder if there is anti-spam protection that prevents too many E-mails form going out or something...
"If you're an ugly chick, you're basically the same as a dude... I mean, you're gonna have to work."

Advertisement: