Topic: New release :: Attachment Mailer class (Read 1297 times)
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6280
38506 credits Members referred : 374
It's time to use PHP5!
« on: Nov 13, 2006, 10:38:31 PM »
date: 2006-11-13 version: 1.20 RN: Since this version the class is changed into a full featured html mailer class incl. html mail + (inline) attachments, alternative text format, inline attachments mixed with external attachments and much more. Most methods are changed and the structure how an objects is defined is updated, too. You need to update formerly mail scripts, check the updated documentation.
Just another rainy day
Posts: 1
6 credits Members referred : 0
« Reply #1 on: Sep 15, 2007, 05:29:19 PM »
This is a solution for small bug (I think) in version 1.2. My antispam service seems to mark emails sent with AMc always as "spam" because the missing empty line after the end of headers.
The solution is to change, around line 226
Code:
$this->headers .= "This is a multi-part message in MIME format.".LIBR;
with
Code:
$this->headers .= "This is a multi-part message in MIME format.".LIBR.LIBR;
quick and dirty
To avoid overhead of CPU if you need to send multiple emails with attachments, change class as follow:
add in the "class var" section
Code:
var $body_message='';
and change in function process_mail
Quote
$body_message=$this->build_message(); if (mail($this->mail_to, $this->mail_subject,$body_message , $this->headers, "-f".$this->webmaster_email)) {
in
Code:
if ($this->body_message==''){ $this->body_message=$this->build_message(); } if (mail($this->mail_to, $this->mail_subject,$this->body_message , $this->headers, "-f".$this->webmaster_email)) {
finally add this new method
Code:
function ForceChangeDestinationTo($new_email_address){ if($this->check_mail_address($new_email_address)){ $this->mail_to=$new_email_address; } }
if ($test->ForceChangeDestinationTo("name2@domain2.com")){ $test->process_mail(); } if ($test->ForceChangeDestinationTo("name3@domain3.com")){ $test->process_mail(); } if ($test->ForceChangeDestinationTo("name4@domain4.com")){ $test->process_mail(); }
I'm working on major improvements.... thanks Olaf for your great work!
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=4784