smtp example please

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

User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

smtp example please

Post by spamyboy »

Code: Select all

while($row = mysql_fetch_array($result)){
if(mail("spamyboy@gmail.com", $subject, $message)) { echo"Ok!</ br>";} else {echo"No...</ br>";}
sleep(1);
}
Could some one give me as SHORTes as possible same mail function example with SMTP protocol.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

Swift Mailer has a nice interface.. just include a couple files and call a couple methods.
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

Post by spamyboy »

I didn't request that, I need simple code wothout any other includes.
Pleas anyone.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

You cannot make mail() use SMTP if it's using sendmail. I have no idea what you are asking really. mail() is just as basic as it look in the manual ;)
Jumba
Forum Newbie
Posts: 23
Joined: Mon Apr 09, 2007 7:24 pm

Post by Jumba »

I don't know what you mean with example to send mail with smtp precisely, but maybe this will help.
http://email.about.com/od/emailprogramm ... 073006.htm
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

Post by spamyboy »

This one uses PEAR.
Jumba
Forum Newbie
Posts: 23
Joined: Mon Apr 09, 2007 7:24 pm

Post by Jumba »

spamyboy wrote:This one uses PEAR.
\

oh, then I don't know.
Try checking the comments on http://us2.php.net/mail and see if there's any examples there.
User avatar
bert4
Forum Newbie
Posts: 18
Joined: Wed Apr 18, 2007 9:44 am
Location: Bali, Indonesia

Post by bert4 »

This one has just one include:

http://www.phpclasses.org/browse/package/346.html

Or search:

http://www.google.com/search?hl=en&q=PHP+SMTP+Class


If you need to connect to gmail however, you will need http://www.swiftmailer.org/
Last edited by bert4 on Sat Apr 21, 2007 10:19 am, edited 1 time in total.
User avatar
neel_basu
Forum Contributor
Posts: 454
Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India

Post by neel_basu »

are you trying to see the compleate conversation with SMTP Server ??
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

Post by spamyboy »

exactly
User avatar
neel_basu
Forum Contributor
Posts: 454
Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India

Post by neel_basu »

OK you Can See the compleate Conversation over here.
but you have to use a class that will show you that.
Go here and download the Class
http://zigmoyd.sourceforge.net/man/mail.php#mail
Please Read This Page for Installation and Instruction on how to use it.
http://zigmoyd.sourceforge.net/man/index.php
And While using it Just Do this Simple Hack / Patch :twisted:

Code: Select all

$mail = new mail("admin@localhost", "Mail Body");
$mail->show_cnv = true;//Show Conversation//Not written in the manual
It will Show the Compleate Conversation Like Cliant Chattion with SMTP server.
I hope this will help you to See the compleate Conversation
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

Post by spamyboy »

Thank you so mutch.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

So how is that different than using Swiftmail, which is the leading php based mailer?
User avatar
neel_basu
Forum Contributor
Posts: 454
Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India

Post by neel_basu »

But 1 question why your ID is spamyboy why its spam. and what does the name mean ??
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

Post by spamyboy »

spamyboy = trash boy;
four years ago I started with: userphp, one day I was totaly <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> of spam & don't remember why bu I named me self spamy, ~3 yr ago it changed to spamyboy, also don't know why.
Post Reply