?
Solved

PHP Mail Attachment  Class

Posted on 2007-10-04
3
Medium Priority
?
573 Views
Last Modified: 2012-06-21
Hi,

I looked at this solution
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_20741309.html
Where gowni pasted a class for mailing with PHP.
I get it to work except that the attached file does not work. The mail code in the mail program looks like this:

<code>

Return-Path: <root@www6.sweweb.net>
Received: from www6.sweweb.net ([194.50.184.136])
      by mail.server.se
      with hMailServer ; Thu, 4 Oct 2007 11:18:57 +0200
Received: (qmail 31209 invoked by uid 2525); 4 Oct 2007 11:17:30 +0200
Date: 4 Oct 2007 11:17:30 +0200
Message-ID: <20071004091730.31208.qmail@www6.sweweb.net>
To: me@server.se
Subject: subject line
From: from@info.se
Reply-To: info@info.se
X-Priority: 2 (High)
Mime-Version: 1.0
Content-Type: multipart/mixed;
 boundary="--ff4c7f0a15c65454757973c98e0d78f8"
Content-Transfer-Encoding: 7bit


This is a multi-part message in MIME format.
----ff4c7f0a15c65454757973c98e0d78f8
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

<body link="#333333" vlink="#333333" alink="#333333">

.........

            </body>
----ff4c7f0a15c65454757973c98e0d78f8
Content-type: image/jpeg;
 name="amandine.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
  filename="amandine.jpg"

/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAQQAA/+4ADkFkb2JlAGTAAAAAAf/b
AIQABQQEBAQEBQQEBQcFBAUHCQcFBQcJCggICQgICg0KCwsLCwoNDAwMDQwMDA8PEREPDxcWFhYX
GRkZGRkZGRkZGQEGBgYKCQoUDQ0UFhEOERYZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZ
GRkZGRkZGRkZGRkZGRkZGRkZ/8AAEQgApQEAAwERAAIRAQMRAf/EAJMAAAAHAQEBAAAAAAAAAAAA
AAECAwQFBgcACAkBAAMBAQEAAAAAAAAAAAAAAAABAgMEBRAAAgEDAwIDBwEFBQgDAQAAAQIDABEE
.........
</code>

Any ideas?
0
Comment
Question by:stalbergpar
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
-Thespian- earned 750 total points
ID: 20013496
Hi, stalbergpar. Why are u using some own class? Try the time-tested solution "PHPMailer". It works good with any count of attachments and Addresses.

Also, it is very functional and free.

View it here: http://phpmailer.sourceforge.net/
0
 

Author Comment

by:stalbergpar
ID: 20014795
Hey,

Yes that is a good question...
Did not work when I tried it last week ... And now I made a new try and it worked...

Tnx
0
 

Author Comment

by:stalbergpar
ID: 20055255
Can also if someone is intrested say that I found a in my eyes better class than phpmailer.
http://www.swiftmailer.org/

It has Throttler for sending mails / min or bytes / min and more stuff end is updated almost every week.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question