Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Sending Html Emails With Attachments


I'm using PHP 4.4.4 Can anyone recommend any good freeware that will allow me to send an HTML formatted email with an attachment? The attachment will also be an HTML file, but it would still be good to have a class/script that allows different attachment types. A key thing here is that the email is able to be viewed in Outlook.




View Complete Forum Thread with Replies

Related Forum Messages:
Sending HTML Emails In PHP
I have a form that my customers can complete, and based on their answers, a results page will display. There are many if/elses in the page to display the proper results based on their answers. This works beautifully.

Now my problem:
I'd like to send them an email with their answers. I'm using the mail() function, and it works fine sending them the email in HTML format when I put static text in there like "Hello World!". However, I need to be able to perform if/then statements and include files into that email based on their answers. I can't get the includes to work at all.

Can anyone offer me some insight here?

View Replies !
PHP Sending HTML Formatted Emails
Just so this is out there on the web, I battled the past 24 hours
about this. Background info... I developed a ecommerce website in PHP
4 on a shared linux hosting plan from GoDaddy and had the html
formatted emails sending as text/html and were going fine with limited
header information. Then we moved the site over to a Dedicated Linux
hosting plan. This time, it's PHP 5. Things are bound to not work as
expected moving to a new programming language.

So what worked in PHP 4:

$headers = 'MIME-Version: 1.0' . "";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "";

Now needs to be (at least what worked for me) in PHP 5

$headers = "MIME-Version: 1.0";
$headers .= "Content-type: text/html; charset=iso-8859-1";
$headers .= "X-Priority: 3";
$headers .= "X-MSMail-Priority: Normal";
$headers .= "X-Mailer: php";

For the life of me I could not figure out why text/html formatted
emails were always sending as plain text and all the information was
shown in the body text using the PHP 4 method.

View Replies !
Sending Multipart Html Emails With PHP Script
After hours of attempts and "googling", I'm still pulling my hair off my
head when I try to send multipart html emails.

It "works" on PCs with Outlook when I juste send a single "related"
mail: one part for the HTML body, and several for the images. However,
the images do not show on a Mac.

I also wanted to have an "alternate", plain text message. I've tried the
method described by Zend and PHPBuilder, but no luck...

I've included a sample of what the email looks like in the end.

Questions: what is the best way to organize the multiparts? Where does
the header stop and the message start ?

MIME-Version: 1.0
From: "Me" <me@truc.net>
Subject: My subject

Content-Type: multipart/alternative; boundary="PIEALT57206"
This is a mulipart message in mime format

--PIEALT57206

Content-Type: text/plain;Content-Transfer-Encoding: 8bit;
charset="iso-8859-1"

Your mail software is not HTML....

--PIEALT57206

Content-Type: multipart/related; boundary="PIEREL57206"

--PIEREL57206

Content-Type: text/html

Content-Transfer-Encoding:8bit

(html code here)

--PIEREL57206

Content-Type: image/jpeg; name="logo.jpg"
Content-Transfer-Encoding: base64
Content-Description: "Image num.9"
Content-ID: Image9

View Replies !
Some Problems With HTML Emails My PHP Site Is Sending
I'm creating HTML emails from a PHP site and sending them out to an email
list (just about 40 people so far are on this list). I've tested and
confirmed that these emails work in yahoo.com's webmail. And I know they
work on *my* Outlook Express. But I have one person (I know of) who gets the
emails as plain text, so she sees the HTML code for the email instead of its
proper representation. She has, like myself, OE6, and other html emails (not
necessarily the emails that come from my site, but HTML emails I've sent her
directly with my OE), have worked OK.

I can't figure it out. I've checked the headers in the emails I've sent her
where it came out as plain text (she forwarded them back to me), and the
"Content-type: text/html; charset=iso-8859-1" line is present, so it's not a
missing header line.

View Replies !
Reading Zip Files From Attachments Of Emails Stored As A Text File
I have a report that is automatically emailed to me every morning, with the corresponding email account setup to save the incoming emails into a .txt file. This email report contains a zipped csv file that is attached.

What I would like to do is to create a php script that when initiated will open this .txt file, grab the attachment, unzip the attachment, read the contents, and add it into a database.

I know how to have script read a file, and then grab the text that I'm interested in, however, once I have this text, how would I go about unzipping it to read the resulting data.

By hand I've tried just taking the attached data, and pasting it into notepad and trying to save it as a .zip file, and then have tried to open it, but I get errors even when I try to do that. "The zipped file is invalid or corrupt".

View Replies !
Sending Attachments
I wish to create a content submision form in which users can submit file attachment such as word document. Can anyone give me some advice regarding security?

View Replies !
Sending Email Attachments
simple question on sending email attachments via a contact form on a website. although because it's for clients i need one of those "browse..." buttons that allows you to search for the file on your computer and then uploads it to the server before sending... if that makes sence. Code:

View Replies !
Sending Attachments Directly From Form
I have a form with a normal upload type form item, now when this form is submitted I want to attach it to an E-Mail, and then send it out.

What do I do in the PHP form processing code to do this? Obviously I would use MIME mail, but what is the easiest way for me to do this.

Specifically this is for attaching a Resume to a job application that will be sent to an E-Mail address immediately. So the file types will be the normal, '.txt', '.doc' etc.

View Replies !
Sending Mail With Attachments Using Sockets
Using Sockets (fsockopen, fputs, fgets, etc.) I'm able to interact
with an SMTP server to send mail. However, do you know the steps
necessary in order to send a file attachment as well?

View Replies !
PHP Mail Function - Sending Attachments
What I am currently working on is a web form that emails me the info submitted, along with an attached file, and writes the info to the database (minus the attachment, im not getting that deep yet)

The code is a combination of a mail script I have been using for a while, and a tutorial I found online. Im having trouble combining the two. My first problem is probably something stupid, though im sure there will be more.

Parse error: syntax error, unexpected T_STRING in /home/sliquidc/public_html/thenannygroup/apply.php on line 96

96 is the mail($to_email, $subject ....... line - and also part of the code from the tutorial. Code:

View Replies !
Sending Attachments Via A PHP Email Script
I am using Pear and its mime package to send an email with an attachment. The email sends properly but the attachment does not. I added a error function to see what the problem is and it says:

File is not readable /root/Desktop/sample.txt

A snippet of my code for it is:

$mime = new Mail_mime($crlf);
$crlf = "";
$status = $mime->addAttachment("/root/Desktop/sample.txt", "text/plain");
$mail = $smtp->send($to, $hdrs, $body);

I have defined $to and $hdrs. I have set the permissions to 777. I dont know what the problem is. Any ideas? It will be much apperciated! Also, is this the easiest way to send attachments? All I need to do is just send one attachment to one email address.

View Replies !
Form Processing And Sending MIME Attachments
I am trying to track down a feedback form similir to Matt Wright's script that would allow the the sending of File Attachements added to the email by the user. I am looking at using MIME email format, with an auto detection of mime type.

I would like the user to select a file via a browse button, then when the form is processed it attaches the file as a mime attachement. Is there anyone who could help me? or provide me with some urlsof where I could find such a script?

View Replies !
Problem While Sending Attachments Using Php Mail Function
I am facing a problem while sending attachments using php mail function.

I am attaching word,excel,pdf,html files in the mail.But some of the receivers who want to see their email as plain text and not as html are getting these attached files as C.DTF format.

How can i handle such receivers who dont have html support for emails,through the code?

View Replies !
Email Attachments - Sending Files Attached Via Mail. What's Wrong?
i wanna send html files (even *.doc) in the body of a mail with this code:

View Replies !
Sending Out 26,000 Emails - How!?!
I need to send out 26,000 emails - on a regular basis...

however, this consumes quite some time and I need to find a way to execute the PHP scriptm, without a timeout and without the user ahving to wait for it (at a rate of 10 emails/second, it's still 70 minutes).

View Replies !
Sending 2 Emails At Once
I'm using the following line in a PHP script, to send a visitor an email from my web page. The $_POST['email'] variable is whatever they enter as their email address into a form:

mail ($_POST['email'], 'Title ', $body);

I also would like the same script to send a little email to me at the same time, with a short message to myself - not the main body variable shown above. Could anyone please explain what I should add into the above code? All I really want is to receive their email address.

View Replies !
Sending Emails
My Hosting Service only allows me to send 250 emails/hour so I send an email every 15 seconds when sending a newsletter. I use a cron job to start the script at 9am and it should keep this script running until it finishes 10 000 emails(newsletter subscribers). After sending each email I log this in a MySQL db. And in my monitor I see that it stops after sending a various number of emails: 100, 400, 1000, 2300 or whatever(it never send all the 10000 emails).

I have set up the maximum execution time variable to 0. Still, I have no idea: why does my emailing script stop? I've watched it myself a couple of times. It shows me no error. The browser just stops from loading after sending a number of emails. (error_reporting is set to 53 - no notices - notices shouldn't stop the script) Also, I have set the abort_user_ignore variable to true.

View Replies !
Sending Too Many Emails
I have a script that takes information from one table (ufJoin) and using its results grabs information from two other tables (users and feeds). Using the information gathered then utilizes a pre-made function and sends an email. For example:

ufJoin contains userid 1 and feedid 1. So the script looks in the users table for the userid matching 1 and takes their email addresses. The script then looks in the feeds table for the feedid matching 1 and takes its url. The table ufJoin will contain more than one entry per user. Meaning, more than one URL is to be used. The URLs found are then attached to a pre-made function and emailed. It sends a new email for every URL instead of just the one! How can I stop this from happening?

View Replies !
Sending Emails From My Computer
I'm trying to make a newsletter and here is my code. PHP Code:

View Replies !
Sending Multiple Emails
I have a little problem with sending multiple e-mails to multiple people. I can't just add recipients onto the "To:" because each e-mail will be different for each person I am sending to.

I have a page sending me multiple variables that relate to different users. Then I go through those variables with a loop, get the related e-mail address, get other info related to that person and other info relating to that variable out of the database and try to send it. It seems to do it and I even get a mailsent - i.e. $mailsent = mail(); - of 1 for all of them, but only the first email ever gets sent. PHP Code:

View Replies !
Sending Lots Of Emails
Is there anything I should note when sending emails to lots of people from a database. i.e. do I need to stop the script to allow the server to send the mails or anything like that?

I am running PHP on Linux, and am looking to send out approximately 12,000 emails. I'm using a web form to populate the email, then just the normal mail function to send, looping round once for each email (i.e. a separate call to mail() ).

View Replies !
Sending Emails In Arabic
I been creating and sending emails in english using the the code given below,
$to = $user_email; Code:

View Replies !
Sending Emails (locally).
is anyone familiar with WAMP5 or the like? for building and testing php/mysql applications locally.

This is basically how I build my site, and it would save a lot of trouble if I could build and properly test emails locally and not need to upload to my web host just for it to work. I use the mail() function.

View Replies !
Server Isn't Sending Emails
It's not a problem with a specific email service. There are people from hotmail, gmail, aol, yahoo and a few others who haven't received the validation link, but others with the same email service have. I have signed up with 2 of my gmail accounts and my hotmail account and I received the validation email each time, and it never shows up in the spam folder.

When I set-up the domain on the server I did nothing to the mail server settings, I just left it with the default settings and it seemed to be working fine, but obviously not. I don't know jack about mail servers, so is there something I need to do to make sure all email are being sent? Code:

View Replies !
Mail() Sending Two Same Emails
<?php
$mymail = '*******';
$mymail2 = "******";
$cc = $_POST['subject'];
$FrOm = $_POST['email'];
$BoDy .= 'First Name: ';
$BoDy .= $_POST['first_name'];
$BoDy .= "";
$BoDy .= 'Last Name: ';
$BoDy .= $_POST['last_name'];
$BoDy .= "";
$BoDy .= 'Email: ';
$BoDy .= $_POST['email'];
$BoDy .= "";
$BoDy .= 'Message: ';
$BoDy .= $_POST['message'];
$BoDy .= "";
$send = mail("$mymail", "$cc", "$BoDy", "From: $FrOm");
$send2 = mail("$mymail2", "$cc", "$BoDy", "From: $FrOm");

if ( $_POST['subject'] == "Lunches"){
$send2; }
if($send2){
echo '<html><head>';
echo '<meta http-equiv="refresh" content="0;URL=contactus_return.html">';
echo '</head><body>Sending, Please hold...';
echo '</body></html>';
}

else {
($send); }
if($send) {
echo '<html><head>';
echo '<meta http-equiv="refresh" content="0;URL=contactus_return.html">';
echo '</head><body>Sending, Please hold...';
echo '</body></html>';
}
?>

When there is Lunches or any other value it sends both emails mymail and mymail2 are active and both send emails. Where is my mistake?

View Replies !
Sending Emails With Delay
i have 300 subscribers. According to my hostings provider mail policy, i can send 200 emails in one hour. So its 18sec/1email.

So what are my possibilities?

1. I can send emails using set_time_limit(0) + sleep(20).
2. Set some cronjob.

Using first method, would force me to have browser window opened for ~1.5h... Not an option. So i guess using cronjobs would be the best thing to do here. But how to invoke/destroy cronjobs from a PHP script. I dont have any shell acc and safe_mode is on.

View Replies !
Sending 1000 Emails ?
I have a small problem :

i want to send emails to 1000 users ( or more , and i will do it very fluently ) , i just want to use pure PHP .

What should i do to solve this problem ?

If i send 1000 mails at a time , will there have any problems ?

View Replies !
Sending Bulk Emails
I'm trying to send a lot of emails from my PHP script. I'm using PHPmailer. I tried to send 1000 emails but only managed to send about 600 of them. So my question for the forum is How do I send lots of emails? Are there different methods? I do not want to send one email with 1000 email addresses. I want to send 1000 unique emails.

View Replies !
Sending Blank Emails
I have the following code

$to=$email;
$from="thankyou@m.com";
$body="dfasdfasdfd safdsaf";
$title="Thank You for shopping at M.com";
$success = mail($to,$from,$title,$body,"From:$from
Reply-To:thankyou@m.com");

for some reason it is not sending the email. I don't get any error but if I do echo $success - then it's blank. Did i do something wrong?

View Replies !
Hotmail Sending My Emails
Ive been working on getting email sent that don't send directly to junk mail for a while now. So far i have my emails getting sent to the inbox of gmail , outlook, yahoo accounts. However im still having trouble with HOTMAIL. Ive been reading around and there seems to be increased settings for hotmail but have yet to be able to configure my system for these.

View Replies !
Problems Sending 2 Emails From Same Script
I need to send two seperate emails from the same script.

View Replies !
Pause In Between Sending 50 Emails At A Time
I am planning to send opt-in emails by chuncks of 30 to 50 at a time
and would like pausing between each chunks

1) is using sleep() feasable or using:?
2) how long should I set the sleep for?

(it will never be over a grand total of +/- 200 emails)

View Replies !
Sending Lots Of Emails In The BACKGROUND?
I'm building a 'job posting' site of sorts.

When a job is available in a particular state, I want the system to send an
email to everyone who is 'watching' that state.

I know how to do this, but I need to figure out a way to 'send the emails
in the background' - ie: if an administrator adds a job to Wyoming, I don't
want them to have to wait for the php script to finish selecting and e-
mailing everyone watching the state before the administrator can move on
and do other things.

I originally thought that passing this task to the PHP command line would
do the trick, but it turns out that a script like...

exec("my php script that emails people");
echo "complete!";

....does not echo "complete!" until the thousands of people have all had
their info passed to the mail server (a long time).

I suppose that I could get rid of this by just lumping everyone together in
the Bcc: field of a single e-mail message, but at this point I'd like to
keep that as a last resort and go with the personalization ("Hi James... a
job has been posted in Wyoming").

Does anyone have any thoughts as to how I can send the emails without
preventing the administrator from doing other tasks until the script has
finished executing?

View Replies !
Stop Cron From Sending Me Emails?
How can I stop Cron from sending me emails? I tried to make the program run without output but it's still sending an email. I heard there was the other method, to make the output go to a file. How can I do this?

View Replies !
Sending Emails To Database List
im trying to add on somewhat of a newsletter feature onto a website. Basically I have a list of email addresses (along with their first and last names) in mysql database.

From here ive created a form, simply its one text box, in which the administrator will type their text into this text box, press submit and the email will be sent to all those in the database.

The part in red (the actual email sending bit) works only if I was sending to one person. But for some reason it doesnt like to looped and used for each row of data (ie each email sending attempt). (edit, the code below doesnt seem to want to go red, but you can see where its ment to!) Code:

View Replies !
Newline Characters And Not Sending Emails Out
I am using a simple mail script to send out emails for a webpage that I designed. The script works fine until I insert the newline character (
). Anytime I insert it, the webpage runs fine but no email is sent out. As soon as I take the newline character out of the mail script, emails are sent out just fine. Code:

View Replies !
Mail Function Not Sending Emails.
im starting to doubt my ability to read the php manual. Somehow this thing is not sending emails. Any thoughts why? (Yes i did change mymail@mail.com into an actual email address. mail('mymail@mail.com', 'My Subject', 'my message');

View Replies !
Sending Emails To A Large Group
I have written a script to send an email to a large list of emails, it works fine except for one slightly major thing. Each email needs to have the receipient's email address at the bottom of the message for removal purposes.

This requires crafting a seperate email for each person. And therefore I must send an individual email for each person. The problem is rate. I need to know how I can rate limit the outgoing messages, and/or make my mta (exim) send lots of messages in one connection (up to 50 per connection).

View Replies !
Script Stopped Sending Emails
PHP Code:

Function SendMail($to,$subject,&$body,&$headers)
{
  $return_path="";
  if(IsSet($this->delivery["Headers"]))
  {
   $headers_values=$this->delivery["Headers"];
   for($header=0,Reset($headers_values);$header<count($headers_values);$header++,Next($headers_values))
   {
    if(strtolower(Key($headers_values))=="return-path")
    {
     $return_path=$headers_values[Key($headers_values)];

View Replies !
Sending Mail: Choice Between Sending Receipt, Or HTML Formatting
I'm using PHP's mail function to send out a message via email.

I would like for this email message to send a receipt when read as well as send an HTML formatted email. Both aspects are important to me.

I know this is a product of the mail header. This is the format I currently have:

mail(to, subject, body, "From: name <email>
Disposition-Notification-To: name<email>
Content-type:text/html;charset=utf-8");

This prompts the email program to send a reciept, but the email message is not in the HTML format, and even contains "Content-type:text/html;charset=utf-8" at the top of the body.

If I switch the order to this format:

mail(to, subject, body, "From: name <email>
Content-type:text/html;charset=utf-8
Disposition-Notification-To: name<email>");

This sends the email with HTML formatting but does not prompt the sending of the receipt. I also get "Disposition-Notification-To: name<email>" at the top of the email message.

This tells me there is a problem in the transition between the headers, which currently is "".

What am I doing wrong?

View Replies !
Mail() Function Sending Emails Trapped By IMF
I am using the simple mail() fucntion in a php script but the emails
that are being generated and being trapped by Microsoft Exchange server
2003 Inteligent message filter as having an SCL rating of 7 or 8, the
highest possible being 9.

This is causing me problems getting the emails delivered to people!

View Replies !
Sending Emails Uing Sendmail Program ?
I want to send emails uing sendmail program directly without using PHP's mail() function.
How can I do this in PHP? Email body texts are in some physical files but email address etc. are in a database.

View Replies !
Sending Emails To Email Addresses In A Database
Basically have a customer sign up form a site, where they can check a box to say they want to receive updates / offers etc.

So what I'm looking to do is enable the site owner to send emails to all those who have done so from the site.

ie get addresses from the email field in the cutomers table where the value of the receiveUpdates field = yes.

How would it typically work exactly - I imagine a form on a page where the owner can type in a title and message, hit a button that actions a php page that retrieves the correct records, and sends out the email.

View Replies !
Problem With Sending Mutliple BUT Personalised Emails...
My problem as the title states is sending multiple emails that have to be personalised. Now, being dumb when it somes to creating email and having 0 (zero) knowledge of the email servers I started using phpmailer class to achieve what I need in this mailing list I created out of customers of my clent's site.. Code:

View Replies !
Mail Function Sending Double Emails
I have a script I'm using to send me e-mails when someone registers for an event I'm holding. But it's sending the e-mails twice. How can I fix this? Can anyone help? My host uses qmail. I get no errors reported. Here is the function as I'm using it:

mail('address1@host, address2@host', $subject, $messageproper, "From: "$yourname" <$email>
X-Sender: My site name" );

I have a value passed to the variables "yourname", "subject", "messageproper", "email" from a form I've set up.

Any ideas what's causing the double emails and how to solve this problem?

View Replies !
Sending Individualised Emails From A Remote Server
I have been trying for several days to develop a mass email system which can handle HTML content, can mail out to multiple addresses and where I can individualise the content using each recipient's first name (Dear John).

I was recommended phpMailer which seems to offer everything I needed but I could not get it to connect (via SMTP) to the remote mail server I am using.

I then tried htmlMimeMail which also did everything I needed. I got it up and running, but when I tried to loop through the recipents addresses adding each recipients name to the body of the email the inbuilt function could not execute fast enough to keep up with the loop. Hence emails were sent to each recipient but each had the same name in the body, the first in the array.

View Replies !
Problem With Sent Text/html Email + Attachments
I send a newsletter from script online. Email is sent in txt and html format, and this is ok The problem is with the attachment. I see and can open attachment ONLY in outlook express I copy below header's email Code:

View Replies !
Mass Mailing - Sending SMTP Emails Via PHP Page
I am sending SMTP emails via my PHP page, I am sending about 20 SMTP emails (stress testing) one after another, these emails are sent via a FOR loop (has one MySQL seek for email address in each loop)(with NO forced delay what so ever). Code:

View Replies !
Sending Mail Using Smtp Authentication To Send Emails
I need some one to help me with sending mail using smtp authentication to send emails in this script. i got this far but i do not know how to setup this to sending mail using smtp authentication to send emails. Or how do i edit this so the top script work together.

View Replies !
Upload An Image Update The Cach...and Sending Emails...
In my site I have it so users can upload images of themselves. After I upload a new image, it still shows the old one until I hit refresh. Is there any way to update the cache so the new image is automatically shown and you don't have to hit refresh?

Second question. In my site I have a confirmation email system. When I send the email to some mail systems, it is automatically sent to their spam folder. What measures can I take to ensure my emails aren't seen as spam?

View Replies !
Stopped My Regular Mail() Function From Sending Out Automatic Confirmation Emails.
My Website host has installed suexec on Apache and this has stopped my regular mail() function from sending out automatic confirmation emails when a user submits a form for membership. I am not sure how to change my script to make this work again.

View Replies !
Html In Emails
I am having some trouble with html and emails. I have this script which is suppost to send a html email, although the html is just appearing in plain text. PHP Code:

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved