TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-01-2008, 08:30 PM   #1 (permalink)
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default SMTP or PHP mailing?

Another question on the whole mailing concept.

I've noticed that mail() takes up to 0.7 seconds of your script to send it. I believe that it's because it waits for confirmation.

Now, there are certain mail servers which you access. For example, I am using with my localhost the ISP host. That's the one who provides my Internet, for those who don't know.

Now, I've heard that PHP makes sure that the mails are being sent. Next to that, there are certain programs that allow instant sending (large newsletters, also phpBB uses it) in an instant. When the script is executed, it's all up to the mailserver. Then you're going on to the whole idea of spamming. People imput sleep(#); between the for loops to send emails. This is to prevent an overload and to prevent the mailserver from complaining.

Anyways, now the question is, how hard is it to make your own. I've seen scripts like phpMailer and SwiftMailer, but I rather create my own. Not only to gain in-depth knowledge but I like the challenge as well. That way, I do not have to rely on other systems to do your job for ME. (like lawyers...)

Can you guys give me some possibilities here? Since I am out of options and everytime I send a mail, I am annoyed by the load time.

Mark
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote
Old 01-01-2008, 08:41 PM   #2 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

Quite simply really. Probably the best way is to connect using fsockopen and then send the data using fputs/fwrite. SMTP, as it's a protocol, has commands such as: HELO TalkPHP.

You'll be able to find the RFC for the SMTP protocol in many locations, though I don't know its RFC number off hand. Even HowStuffWorks, if you go to the "How Email Works" article - that will give you a basic run down of how to send an email using SMTP via Telnet on the 3rd or 4th page in the article; if I remember rightly. Same principle applies to sending the email through a PHP script.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 01-01-2008, 09:15 PM   #3 (permalink)
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default

If I understand it correctly, you simply open fsockopen and send with the fputs/fwrite the command EHLO or HELO with after that the domain?
  • HELO - introduce yourself
  • EHLO - introduce yourself and request extended mode
  • MAIL FROM: - specify the sender
  • RCPT TO: - specify the recipient
  • DATA - specify the body of the message (To, From and Subject should be the first three lines.)
  • RSET - reset
  • QUIT - quit the session
  • HELP - get help on commands
  • VRFY - verify an address
  • EXPN - expand an address
  • VERB - verbose
But how does it go from there? I know it accepts commands like MAIL and such but how do you lay the connection and really send the mail. Maybe someone can type it out for moi?
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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


All times are GMT. The time now is 07:29 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design