PHP Classes

SMTP - HTML - ATTACHMENT

Recommend this page to a friend!

      SMTP E-mail sending class  >  All threads  >  SMTP - HTML - ATTACHMENT  >  (Un) Subscribe thread alerts  
Subject:SMTP - HTML - ATTACHMENT
Summary:How to use SMTP in conjuction with MIME message class.
Messages:6
Author:vijay anand
Date:2011-10-07 04:24:02
Update:2011-10-07 09:39:09
 

  1. SMTP - HTML - ATTACHMENT   Reply   Report abuse  
Picture of vijay anand vijay anand - 2011-10-07 04:24:02
Hi all.,

i ve successfully tested the MIME class and send emails with html | attachment.

and i also successfully tested the SMTP class and send plain text emails.,

but i want to send a html | attachment mail using SMTP class.,

i searched through the forum and i found only the link tht says "use it in conjuction" with MIME., but i exactly dont knw how to do tht.,

bcoz the SMTP class using

$message_object=new smtp_message_class;

and to the send function is

Function smtp_mail($to,$subject,$message,$additional_headers="",$additional_parameters="")
{
global $message_object;

return($message_object->Mail($to,$subject,$message,$additional_headers,$additional_parameters));
}

and MIME class using

$email_message=new email_message_class;

and the send function is

$email_message->Send();

so i dont know exactly how to integrate these two..

kindly help me..

thanks in advance..

  2. Re: SMTP - HTML - ATTACHMENT   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-10-07 05:19:14 - In reply to message 1 from vijay anand
Just take a look at the examples of the MIME message package to send messages with attachments. Then change the class being used to smtp_message_class instead of email_message_class. You may need to add a few parameters to set some options to configure SMTP server access. The rest is the same.

  3. Re: SMTP - HTML - ATTACHMENT   Reply   Report abuse  
Picture of vijay anand vijay anand - 2011-10-07 06:04:16 - In reply to message 2 from Manuel Lemos
Hi thanks for ur reply..

it works well

but it goes to spam.,

In my windows live mail when i checked for the properties the spam level is high when i send it using this method

X-Spam-Status: Yes, score=8.2 required=7.0

but when i tried plain text it was quite low and not a spam

X-Spam-Status: No, score=6.2 required=7.0

any suggestions..

Many thanks.

  4. Re: SMTP - HTML - ATTACHMENT   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-10-07 07:03:37 - In reply to message 3 from vijay anand
That may happen if you are sending an HTML message without an alternative text part. Look at the test_simple_html_mail_message.php example to learn how to send HTML messages with alternative text parts.

  5. Re: SMTP - HTML - ATTACHMENT   Reply   Report abuse  
Picture of vijay anand vijay anand - 2011-10-07 08:46:45 - In reply to message 4 from Manuel Lemos
Many thanks.,

i have one more query..

i need to attach the files uploaded by the users.,

the code says:

$attachment=array(
"Data"=>"This is just a plain text attachment file named attachment.txt",
"Name"=>"attachment.txt",
"Content-Type"=>"automatic/name",
"Disposition"=>"attachment",
);
$email_message->AddFilePart($attachment);


i tried changing the filename with a file in the same folder., but only the filename changed not the datas inside the file..

so how can i do this attachment ..

once again thank u..

  6. Re: SMTP - HTML - ATTACHMENT   Reply   Report abuse  
Picture of vijay anand vijay anand - 2011-10-07 09:39:12 - In reply to message 5 from vijay anand
Hi manuel.,

i found the answer by myself.,

just by referring to the test_attachment_message.php..

thank u for the wonderful class files..