Old 03-11-2005   #1 (permalink)
Red Dawn
 
BlodoPKNZ's Avatar
 
Join Date: May 2004
Location: Eastern Europe
Posts: 302

The other way of sending mail in php

Making myself a cms as im doing now i ran into the problem of reseller servers. These are becoming quite popular but its also a fact that a lot of them (and i mean a real lot) have the mail() function turned off (with the explanation of trying to halt sending spam, like that will help). Changing the ini settings at runtime isnt the best of ideas to me. Now im really really positive it is possible to send a data stream to a smtp server without calling the mail() function. The problem is how to do it. Also i have absolutely no idea how to format the data to be sent. Anyone got any experience on this?
__________________
BlodoPKNZ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 03-12-2005   #2 (permalink)
Invicible Snake
 
ParaSnake's Avatar
 
Join Date: Sep 2004
Location: Ho Chi Minh City,Vietnam
Posts: 668

Send a message via MSN to ParaSnake Send a message via Yahoo to ParaSnake
I have no idea on it,but can PEAR do this?,its a very powerful package include 2 mail functions on it,have you tried it yet?
__________________
ParaSnake is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 03-12-2005   #3 (permalink)
Red Dawn
 
BlodoPKNZ's Avatar
 
Join Date: May 2004
Location: Eastern Europe
Posts: 302

Hmm no i havent tried PEAR yet, actually i tried to make my cms without using it. Dunno i have to learn more about it.

Meanwhile lets try and figure out the 'pure php' way. I personally have been thinking about using sockets to send a stream to the smtp server but i have no idea how should i configure the string for it not to be rejected. Anyone?
__________________
BlodoPKNZ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 03-15-2005   #4 (permalink)
Registered User
 
inkblot's Avatar
 
Join Date: Mar 2005
Location: London, ON
Posts: 12

Send a message via AIM to inkblot Send a message via MSN to inkblot
i'm getting by fine building mine using mail(); but i think PEAR is going to be your best failsafe solution. i haven't read too much on PEAR yet, but i was reading through some other snipptes from a really advanced cms and it's PEAR crazy, so if pear fails i don't know what won't.
inkblot is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 03-15-2005   #5 (permalink)
code anyone?
 
scrowler's Avatar
 
Join Date: Feb 2004
Location: New Zealand
Posts: 590

Send a message via MSN to scrowler Send a message via Skype™ to scrowler
another php function for mailing:
imap_mail() - ref.

pear functions:
PEAR::mail - ref.
PEAR::Mail_Mime - to decode or encode MIME messages - ref.

an all php alternative to mail() provided by scott at criticalpath dot com (php.net commentor):
Code:
<?php
function sendmail($to='', $subject='', $message='', $headers='', $extra='')
{
   $fd = popen("/usr/sbin/sendmail -t $extra", 'w');

   fputs($fd, "To: $to\n");
   fputs($fd, "Subject: $subject\n");
   fputs($fd, "X-Mailer: PHP4\n");

   if ($headers) {
       fputs($fd, "$headers\n");
   }

   fputs($fd, "\n");
   fputs($fd, $message);
   pclose($fd);
}
?>
__________________
BioRUST Tutorials - the birthplace
scrowler is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT +1. The time now is 04:17 PM.
Content Relevant URLs by vBSEO 3.2.0

Design & Content © BioRUST 2008 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT