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 Email With Mail();


i have set up this script from other scripts but sometime it does not send any email and other times it does
with this im not shure why,i have edited other mail scripts and finaly come up with this which when it works works well.
there are two identicle mail functions there the first sends a email to the user saying thanks for registering the second sends a email to 4 admins telling them about the new user.

can you pick out why it,s not working?




View Complete Forum Thread with Replies

Related Forum Messages:
Sending HTML Email Using The PHP Mail Function
I am encountering a very strange problem when sending HTML email using the PHP Mail Function. Each email that goes out has a "! " inserted into the body of the message... I have checked the body code and it is definitely not in there...

View Replies !
Sending Php/html Document As An Email Using Php Mail() Function
I need to send the following code in an email ... but its a mix of php and html, and it retrieves various values from a database before sending...oh and i wouldnt mind the sending of the mail to be done on a button click!;)...anyways i have messed and messed but i aint too sure whether it can be done! Can someone please tell me the code and where i need to place it within my code? .....

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 !
PHP Mail Not Sending Mail To Itnernal Email Address
Running a PHP mail script on Linux which has Exchange as the mail
server. The script does not send mail to any internal email address but sends
it to any other address outside its domain!

View Replies !
Sending HTML Mail To Outlook Express With Mail()
I'm sending out an HTML mailer using the mail() function in PHP. I'm appending all of the headers to the message. This message displays correctly in Hotmail, Outlook 2000, and even Mac's OSX mail client. But, for some reason, Outlook Expess (on Win XP & OSX) displays the HTML code and doesn't render it.

If, however, the recipient copies the HTML code and composes a new HTML message in Outlook Express, it gets sent correctly.

This particular user is also getting other HTML mailers that display correctly, so I know that the client is capable of accepting HTML mail.

I'm led to believe that PHP's mail() headers are not being interpreted correctly. In fact, they appear as the first 3 lines in the body of the message when viewed in Outlook Express. OK, here are some samples to tie this all together: First, the mail() code I'm using: PHP Code:

View Replies !
Send A Email With Html As Well As Php.sending The Email
im trying to send a email with html as well as php.sending the email is the easy part.the problem is with the message part.if i put this code in the textarea it display the html tags in the email.yet the php is fine. Code:

View Replies !
Sending Email Using Mail()
these are my codes:

$headers = "From: ".$_POST["fromEmail"]."";
$headers .= "CC: ".$_POST["ccEmail"]."";
$toEmail = $_POST["toEmail"];
$subEmail = $_POST["subEmail"];
$conEmail = $_POST["conEmail"];

if( mail( $toEmail, $subEmail, $conEmail, $headers ) )
echo "Mail sent";
else
echo "Mail send failure - message not sent";

when i trying sending email, it gives me this errror SMTP server response: 500 please set from & to first.

View Replies !
Sending Html Email Using Php
I'm trying to send a html email using php (and it think qmail)

Here is the code i have so far:

$headers .= "MIME-Version: 1.0";
$headers .= "Content-type: text/html; charset=iso-8859-1";
send_mail($row["UserID"], $subject, $message, $headers);

Why does this not work?

Here are the headers i get in my email client:
Return-path: <root@server1.domain1.com>
Delivered-To: 1-owner@domain1.com
Received: (qmail 15148 invoked by uid 48); 7 Aug 2004 15:14:01 -0000
Date: 7 Aug 2004 15:14:01 -0000
Message-ID: <20040807151401.15147.qmail@server1.domain1.com>
To: owner@domain1.com
From: webmaster@domain2.com

View Replies !
Sending Html Email
I tried adding <html><body> etc to the contents of the email I send with the php function php() but I just can't seem to get it to show up as html... is there some trick I need to know to achieve this?

View Replies !
Sending Html In Email
how to send email with html codes?

View Replies !
Sending A HTML Email
I was just emailing text but it's becoming quit messy so thought I'd try and send it as a HTML, I have been able to format it and I can get a result from the top of the page, but how do I combine that with all my php & SQL Query? Code:

View Replies !
Mail() Sending Two Copies Of Email
I have set up a the following mail() script to email a pdf file to one user.

$fp = fopen("flirbys.pdf","r");
$str = fread($fp, filesize("flirbys.pdf"));
$str = chunk_split(base64_encode($str));

$to = "user@email.com";
$user = "Joe Blow";
$email = "jblow@anywhere.com";
$subj = "Mapping and Drafting Request";

$headers = "From: $user <$email>";
$headers .= "Reply-To: $user <$email>";
$headers .= "MIME-Version: 1.0";
$headers .= "Content-Type: multipart/mixed; boundary="MIME_BOUNDRY"";
$headers .= "X-Sender: $user <$email>";
$headers .= "X-Mailer: PHP4";
$headers .= "X-Priority: 3";
$headers .= "Return-Path: <$email>";
$headers .= "This is a multi-part message in MIME format.";

$message = "--MIME_BOUNDRY";
$message .= "Content-Type: text/plain; charset="iso-8859-1"";
$message .= "Content-Transfer-Encoding: quoted-printable";
$message .= "";
// your text goes here
$message .= "Attached is a Mapping or Drafting Request. Please process as soon as possible";
$message .= "";
$message .= "--MIME_BOUNDRY";
$message .= "Content-Type: application/pdf; name="brilliant.pdf"";
$message .= "Content-disposition: attachment";
$message .= "Content-Transfer-Encoding: base64";
$message .= "";
$message .= "$str";
$message .= "";
//message ends
$message .= "--MIME_BOUNDRY--";

mail($to, $subj, $message, $headers);

It works great except the $to user gets two copies of the email. I've tried changing email addresses with no success.

View Replies !
What Headers To Use When Sending Email Using Mail()
Anyone want to give good examples of what headers to use when sending email using mail() so that email gets accepted from more then less people. Seems to me that headers play a large part if email is to be put in inbox instead of trash or treated as spam.

View Replies !
Mail() Function Isn't Sending The Email.
I've just built my first PHP form handler that will save the form data to a text file on my server and then email me an alert, but the Mail() function isn't sending me the email.
I have set it to send to my gmail account but I don't receive it in my inbox or spam. How can I make it email me properly?

View Replies !
Sending Email - Php's Mail Function
I tried sending mail with php's mail function and i filled in the From: option in for the header but when ever i send an email to gmail and im assuming other webbased email its blocked by the email or is put in the spam folder does anyone know how to make it so emails are sent to the inbox?

View Replies !
Sending Html Via Mail
I want to send mail that is formatted as nicely as possible.
For this, I plan to send raw html code URL...but the mail prints out the html also...how do i make the html formatting show ?? I guess I'll have to add some specific header...is it true ??

View Replies !
Sending Html Mail?
I made a .html file taht I want to send by mail, but not as a attatchment. I want it to be sendt as a html mail.

I could use microsoft word and send it trough there, but word will change some of the html code.

View Replies !
Sending HTML Mail Using PHP
I know how to send plain text e-mail using PHP's mail() function, but how to send HTML e-mails using mail() function.

View Replies !
Sending Html Mail
A client wants to send out a mail in html including graphics. The idea
is that it looks like a personalised coupon that they can print off.
I've had a look at http://phpmailer.sourceforge.net/ and the html
example seems pretty straightforward but it doesn't give much
information on the graphics. Should the images be sent as attachments
and simply referenced in the html or am I completely off track here?
--

View Replies !
Html Mail Sending
I tried to send emails in html format in this line : PHP Code:

View Replies !
Sending HTML Mail()'s
I have a problem when sending HTML mail (using css). The mails just incluse all the HTML tags... So can you send both text and HTML so that the server receiving can use the text mail if HTML mail is not supported?

Or is it always best only to use plain text as I understand is advised? - it is the first time Ill use the mail() function.

View Replies !
Sending Html Email Using Php Script
I am trying to send a html email from a php script. This script emails
a common information to all the members in the database. The only
problem is I cannot specify colors, hyperlinks etc..Html tags like
<h1></h1>, <br/>, <b> etc works though..

Could any one tell me what i might be doing wrong?

Code:

View Replies !
Sending Html Email By Domains
i have a small idea about a function i could pass the email address through and if it returns true then send s the user a html email else they will get a text email. is this a good way of doing this? PHP Code:

View Replies !
Sending Text And Html In One Email
i've put close to 10 hours into this today and i'm not getting results. i simply want to create and send emails that can be viewed by both text based and html based email clients. i've scoured the PHP manual and related comments and nothing is working. I also don't want to use a big bloated open source library as my needs are simple...text...html...that's it. 

can someone point me to code that's working for them (across all popular email clients) or to a tutorial that actually works?

View Replies !
Sending Forms Via HTML Email
How do I sent content of a PHP form via HTML email?

For example, fields $name, $city, $state, $phone, $location

to HTML:

<p>Congratulations $name from $city, $state with the phone # $phone .
You now get an expense paid trip to $location .

And that HTML outputted in email..so someone checks their email,they
have an HTMl certificate generated from a form in PHP.

View Replies !
Preparing An EMail And Sending It To A Mail Program
I am attempting to create an eMail but rather than send it I need to open it in the local eMail program (e.g. Outlook Express, Eudora, etc.).

I am basically trying to do an extended version of an HTML mailto: tag.

The idea is to have a button that will open up a new eMail message in the local eMail program with everything defined (cc, subject, and message) except for the recipient.

The recipient information needs to be pulled from the local eMail program's address book.

I have pretty much got it done except all of my spaces are plus signs (+) even after I have already urlencoded the information.

View Replies !
Sending Mass Email Fom Php Using Mail Function
I have to send more than 100s of email using a php code if i use mail
function whether it will be sent to spam or inbox. If it is sent to
spam which is the other way to send mass email from php. i have tried
to sent email to 4 to 5 email ids it is going for inbox only but i
have a doubt if i send it to more than 100 email id it may go for spam

View Replies !
Sending An Email To Vtext.com With Mail(), 550 Refused
I am attempting to send an email to [mobile number]@vtext.com to send an SMS. Here is the code that I am using:

$headers = 'From: webmaster@notice.com' . "
" .
'Reply-To: noreply@notice.com' . "
" .
'X-Mailer: PHP/' . phpversion();

mail($email, '', $body, $headers);

However, the message does not go through, I receive a message failure notification shortly after. The failure is as this: Code:

View Replies !
Sending Email - Mail() Function Or Phpmailer
sending email in hebrew using either the mail() function or phpmailer will result in sending gibberish. how do I fix this?

I tried setting the headers to support UTF-8 and windows-1255 and nothing worked. the encoding of the document im sending the email from is ANSI. how do I fix this? I also tried converting the string to utf8 using utf8_encode.

View Replies !
Simple Script In Sending Email Using Mail
i have created a simple script in sending email using mail, is it possible to program a script to make sure my email was sent to the recipient?

View Replies !
Sending HTML Using The Mail() Function
Im trying to send html via mail() but its not outputing the html. Is there something I need to alter in php.ini Code:

View Replies !
Sending Mail In HTML Format
I am sending mail through PHP but the HTML tags are not working, Code:

View Replies !
Sending Both HTML And Plain Text Email.
I am using php to send weekly newsletters to my mysql database, the emails are always in HTML only.

I was wondering if anyone knew how to send both types so that if they can't view HTML emails it will show just text?

View Replies !
Sending The Contents Of A Php Array In A Html Email
I'm creating a site that posts orders to an email address when they're
submitted, these orders need to be in the form of official invoices so
i'm using HTML to format them.

I already have a shopping basket system which adds all of the totals
up and puts them into a nice looking invoice.

What's the best way to take this HTML and put it into an email?
I'm really looking for a way of sending the page via email, like you
can do in IE by selecting File > Send > Page by Email.

The basket script is quite large and i'm trying to avoid running it
more times than neccesary.

View Replies !
Sending Html Email Using PHP Default Method
Can we send HTML emails using PHP's default mail method?

View Replies !
Sending Mail In To Email Addresses In Mysql Database
I want to send mails using php to a list of email addresses stored in a table in a mysql database.

View Replies !
Sending A Html Document Using Mail() Function
I need to send the following code in an email...but its a mix of php and html, and it retrieves various values from a database before sending...oh and i wouldnt mind the sending of the mail to be done on a button click!...anyways i have messed and messed but i aint too sure whether it can be done! Can someone please tell me the code and where i need to place it within my code? 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 !
Error In Sending Html Page With Attachment In Mail
i am sending a mail with attachment. the text mail with attachment is going in rght way ...but when i try to send a HTML Mail(text coming from a HTML Editor) with attachment the mail .. i got some kind of error ... the mail and attachment goes .. but the problem is the HTml page display as its is ...like its display as source code whatever a typed in editor..

View Replies !
Shows Html Code While Sending Mail Problem ??
I am using my mail function to send the mail, mail successfully goes but the problem is its shows all the html codes and also the name is blank in the from section (Note: I am using outlook express) Code:

View Replies !
Mail() & HTML Email With Images
I've been busy with sending email by using the PHP mail() command. I tried to send a mail with HTML layout but somehow the images didn't work..

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
<?php

$adress = 'mymail@internet.com'
$subject = 'MyMail'
$message = "<body bgcolor=#0088ff><img src="www.mydomain.com/printer.gif"><font face=arial color=white>This is <b>a</b> test</font>";
$extra = "From: "MySelf" me_and_myself@internet.comnReply-to: me_and_myself@internet.com";
//$extra .= "nReturn-Path: <me_and_myself@internet.com>";

$extra .= "nContent-Type: text/html;";

if ( ! mail ($adress,$subject,$message,$extra)) { // [, string additional_headers])
print( "Blieb! Error!" );
}

?>

Can anyone tell me what I'm doing wrong or what I'm forgetting? I know it's possible because I receive a lot of mailings with images in them (is very frustrating)

View Replies !
Mail() HTML Email Not Working
I have just signed up to a Virtual Server and I'm having issues with sending email via mail() in HTML format.  I have a simple script to test the server and it's not working correctly.  The receiving server does not understand it's an HTML email.  On another server, this script works perfectly: Code:

View Replies !
Send HTML Email Via Php Mail()
I'm using php function mail() to send emails. However, I can only text. Can I send HTML mail which inclids <a> links, <img> imgs, and font styles?

View Replies !
Sending MIME Format Email Without The PEAR Mail Mime Package?
Just wondering if anyone could please help. I would like to use PHP to send
MIME format emails (with binary attachments). But I have to do this without
the use of the mail mime PEAR package? We are on PHP 4.2.2 and we cannot
change that, and we cannot install that PEAR package due to our web hosting....

View Replies !
Hiding The Receipeint Email Address While Sending Email
i am sending an email using php. i dont want the receipeints to see the to address. the problem is i am sending to a mailing list email address. so how can i hide the to address and the from address if possible?

View Replies !
Sending Mail In Omni HTTPd With Mail()
Whenever I try and use the mail function I get a "Failed to Connect" error. I'm running PHP4.0, Omni Httpd 2.06 on Win98. Is there something else I have to do to enable email? I know if worked before on PWS, but I switched because I couldn't get PHP4 to run under PWS. Any help is greatly appreciated.

View Replies !
Sending Mail Without The Mail Client Popping Up
I was wondering how to send a mail without the mail client popping up to the user.

I want to send a mail to myself, when a user pushes a button on my homepage. Any ideas?

View Replies !
Mail Form Not Sending Mail - Server2003
I am trying to test a simple feedback form. I have php 5.0.3.3 on my dev
Windows server 2003. SMTP is working fine, as we all use it to send mail
from. PHP works fine as well, but I just cant get mail sent by php, although
no errors are reported.

Do I understand it correctly that this simple script should send me a mail?
This is just to test that it works.

<?php
mail('me@whatever.com', 'My Subject', 'message');
header( "Location: http://webserver/message_sent.htm" );
?>

Okay, the " Location: http://webserver/message_sent.htm" comes up fine, and
"<?php phpinfo() ?>" also works fine. SMTP allows relay from my subnet and
does not need authentication.

View Replies !
Mail() / Sendmail Sending Mail As Spam
Wondering if anybody knows why when sending mail through my local sendmail program using the PHP mail() function; emails either do not reach the destination, or register as spam? Prime example is: h0tm@il addresses never receive the email, gmail addresses consider the email to be spam, and my workplace receive the email about 1 hour after the program finishes.

Could it be a problem with my ISP? I am using Fedora Core 6, PHP 5 and Apache 2. Or test it yourself.. just fill out the form with some rubbish and it should send an email saying you've registered.. maybe you can figure out where I am going wrong by looking at the headers? http://aaronweb.no-ip.com:6969/?p=2

View Replies !
Sending Mail To Hotmail Using The Mail() Function
I have been doing some research into how to send mail to a Hotmail address using the mail() function provided in PHP, in previous posts I may have been wrong in mentioning that you need to add your mail server to the hotmail PostMaster website using Smart Network Data Services (SNDS), after doing some research I have found that in order to send e-mail to a Hotmail address you need to add/ask your host to add an SPF record to your domain.

What is SPF?

Well, SPF is a protocol used to eliminate forged e-mails, much like SSL certificates help eliminate phising websites. Microsoft use the SPF record against the SenderID Framework that they have in place.

How do I go about obtaining an SPF Record?

Easy! use the Microsoft wizard found at:

http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/

to generate a unique SPF record for your domain, then add it to your DNS server, or ask your web host to do this.

I manage my own DNS server, how do I add an SPF record to a domain?

To begin, open the DNS MMC from the Administrative Tools menu of your Windows Server 2003 system. Next, find the domain that will host the SPF DNS lookup record. 

Highlight the folder for the domain, and select Other New Records from the Action menu. You can also access this menu by right-clicking the domain folder.

The resource Record Type dialog box will be displayed. From the Select a Resource Record Type area of the screen, scroll down the list and select Text (TXT) from the list.

Click Create Record. This will bring up the New Resource Record dialog box to appear. This is where you paste the SPF record generated by the above website

----------------------------------------------------------------------------------------------------------------------------------
I hope this helps, I have tried it myself and e-mails went straight to my inbox (not junk mail). Would also appreciate feedback if this works for other providers such as Yahoo! etc as I have not tried it with them

Give me your feedback on how it works for you, also if it works possibly make this thread sticky as I'm sure it will resolve many problems for people out there who are denying access to people who have public email addresses.

View Replies !
Mail() Function Doesn't Seem To Be Sending MAIL FROM: Properly
I'm trying to send an email using the mail() function. I've carefully made use of the ini_set(SMTP, "mail.my.server") function to set my SMTP server and also to set my From: address. I'm still getting a "Relaying not explicitly allowed: fakeemail@fakedomain.com" response from the server however, when I try and set a recipient who is outside of my own
domain. This makes my think that the From: address is somehow not getting sent to my server properly or that I'm pointing at the wrong server.

The confounding thing is that it was working for a while and I don't think I changed anything and it just stopped.

I'm running these PHP pages for a client off of one of those cheap hosting services, I think it's called 1dollarhost.com or something, although I can't remember at the moment.

Has anyone else had trouble with this or found a solution?

View Replies !
Sending Mail Otherthan Mail()
My server admin has blocked the mail() due to some spam problems. I
need to send emails using php. Can anyone guide me to the best method
of sending emails using php without using mail().

If there is any tweak to be done at the server level I will be able to
convince the admin. The server has linux Enterprice edition 3 with php
4.3.11 and cpanel/whm.

View Replies !

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