By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,994 Members | 2,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,994 IT Pros & Developers. It's quick & easy.

PHP mailer script

P: n/a
I would like to set up a PHP page which my staff can use to select
attachments and send them to a specified email address.

There will be a list of about 10 alternative attachments (brochures) in
PDF format which are stored on the server. These are information
brochures for customers, and I dont want any other files to be able to
be emailled.

So, what is the best approach/scripting approach to do this. Basically I
want to have a form with:

- Customers name
- Customers email address

where the email will go to "Customers name <cu************@isp.com>"

- check boxes for the different attachments

- and a comments area which will form the body of the email.
The email that the customer receives will have our default Sender name,
email address and subject, plus the selected attachments and the body of
the message as specified in the form.
Can someone please suggest some code for this, I am even willing to pay
for this, will pay USD through Paypal or similar.

Please email me simon-@-direct-mobile-.com-.au- (remove hyphens)

Thanks
Simon

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
simec <no*******************@paradise.net.nz> wrote:
I would like to set up a PHP page which my staff can use to select
attachments and send them to a specified email address.

There will be a list of about 10 alternative attachments (brochures)
in PDF format which are stored on the server. These are information
brochures for customers, and I dont want any other files to be able to
be emailled.

So, what is the best approach/scripting approach to do this. Basically
I want to have a form with:

- Customers name
- Customers email address

where the email will go to "Customers name <cu************@isp.com>"

- check boxes for the different attachments

- and a comments area which will form the body of the email.
The email that the customer receives will have our default Sender
name, email address and subject, plus the selected attachments and the
body of the message as specified in the form.

Can someone please suggest some code for this, I am even willing to
pay for this, will pay USD through Paypal or similar.


Hi Simon,

This is really relatively simple.

The section in the form where users choose the attachment(s) would be
either:
a) automatically generated, when list of attachments often change
b) hard coded, when the list of attachments doesn't change

a:
Look at opendir():
http://uk.php.net/manual/en/function.opendir.php
You loop through all the attachments in a specific directory and
generate the HTML output containing checkboxes.

Sending the email is easy - you could use on of many readily available
HTML MIME classes, which allow you to add attachments, or write your
own. AFAIK one of the most widely used MIME mail classes is the one
written by Richard Heyes: http://www.hotscripts.com/Detailed/4682.html

HTH;
JOn
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.