![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| My webhost decided from one day to the next to disable sendmail, because, they say, it was being exploited for spamming purposes. This means I have to go back and rewrite some scripts I wrote a long time ago. (aaarrrgghh) They are usually in the form of: $sendIt = mail ("$toName <$toEmail>", $title, $message, $headers); What would be the simplest way of changing the scripts to mail through an SMTP server? What do I have to pay special attention to? thanx, ..soma -- ps: I have socket support | |||
| Advertisements |
| | #2 | ||
| "somaBoy MX" <none@nonesuch.net> schreef in bericht news:3f5700a5$0$446$ba620e4c@reader2.news.skynet.b e... > My webhost decided from one day to the next to disable sendmail, because, > they say, it was being exploited for spamming purposes. This means I have to > go back and rewrite some scripts I wrote a long time ago. (aaarrrgghh) > > They are usually in the form of: > $sendIt = mail ("$toName <$toEmail>", $title, $message, $headers); > > What would be the simplest way of changing the scripts to mail through an > SMTP server? What do I have to pay special attention to? > > thanx, > > > .soma > -- try this one worked for me!! G function socketmail($toArray, $subject, $message) { // $toArray format --> array("Name1" => "address1", "Name2" => "address2", ....) ini_set(sendmail_from, "norepley@email.nl"); $connect = fsockopen (ini_get("SMTP"), 25, $errno, $errstr, 30) or die("Could not talk to the sendmail server!"); $rcv = fgets($connect, 1024); fputs($connect, "HELO {$_SERVER['SERVER_NAME']}\n"); $rcv = fgets($connect, 1024); while (list($toKey, $toValue) = each($toArray)) { fputs($connect, "MAIL FROM:norepley@email.nl\n"); $rcv = fgets($connect, 1024); fputs($connect, "RCPT TO:$toValue\n"); $rcv = fgets($connect, 1024); fputs($connect, "DATA\r\n"); $rcv = fgets($connect, 1024); fputs($connect, "Subject: $subject\n"); fputs($connect, "From: BOT-mi <norepley@email.nl\n"); fputs($connect, "To: BOT-mi lid <$toValue>\n"); fputs($connect, "X-Sender: <norepley@email.nl>\n"); fputs($connect, "Return-Path: <norepley@email.nl>\n"); fputs($connect, "Errors-To: <norepley@email.nl>\n"); fputs($connect, "X-Mailer: PHP\n"); fputs($connect, "X-Priority: 1\n"); fputs($connect, "Content-Type: text/plain; charset=iso-8859-1\n"); fputs($connect, "\n"); fputs($connect, stripslashes($message)." \n"); fputs($connect, ".\n"); $rcv = fgets($connect, 1024); fputs($connect, "RSET\n"); $rcv = fgets($connect, 1024); } fputs ($connect, "QUIT\n"); $rcv = fgets ($connect, 1024); fclose($connect); ini_restore(sendmail_from); } | |||
| | #3 | ||
| "Spam sucks" <nomail> wrote... > > try this one worked for me!! > > G Thanks... it looks good. But what if I need to authenticate with the SMTP server? ..soma | |||
| | #4 | ||
| "somaBoy MX" <none@nonesuch.net> schreef in bericht news:3f571108$0$456$ba620e4c@reader2.news.skynet.b e... > > "Spam sucks" <nomail> wrote... > > > > try this one worked for me!! > > > > G > > Thanks... it looks good. But what if I need to authenticate with the SMTP > server? > > .soma eeehmn i dont know try: http://nl.php.net/manual/nl/function.imap-open.php meaby you can do something with that i used it to read my mail box. you should also use it to send emails trough smtp i think hope that helps G | |||
| | #5 | ||
| Op Thu, 4 Sep 2003 11:07:41 +0200 schreef "somaBoy MX" <none@nonesuch.net>: >What would be the simplest way of changing the scripts to mail through an >SMTP server? What do I have to pay special attention to? Take a look @ http://phpmailer.sourceforge.net/ It's a class that can spare you a lot of time. -- http://www.techtronix.be | |||
| Featured Websites | ||||
|
![]() |
| Tags: advice, apps, mail, porting, sendmail, smtp |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| need advice on php web mail client and php bulk (newsletter) mailer | somaBoyMX | PHP | 1 | 07-01-2007 4:16 PM |
| SMTP for mail() | Peter Chan | PHP | 1 | 07-01-2007 3:53 PM |
| comp.graphics.apps.photoshop | Timo Autiokari | Graphics in general | 2 | 06-12-2007 12:25 AM |
| Using SendMail in Forms w/PHP HTML | jcage@lycos.com | PHP | 3 | 05-20-2007 6:33 PM |
| Featured Websites | ||||
|