WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-04-2004, 06:38 PM
WebProWorld New Member
 

Join Date: Feb 2004
Location: Boston and Seattle, USA
Posts: 5
IT-guy RepRank 0
Default PHP mailer that sends html emails

I've found about a zillion formmail scripts that will send text emails to me, but I've not found any that will send html formatted email to me. My client wants the form results to be easier to read, ie, not a simple text line that says <field> = on.

Suggestions? Pointers?

Thanks!
__________________
IT and Marketing Services
www.steele-marketing.com
Reply With Quote
  #2 (permalink)  
Old 06-05-2004, 02:36 AM
WebProWorld New Member
 

Join Date: Apr 2004
Location: London, England
Posts: 14
virtual_odin RepRank 0
Default

I'm no expert, I only know PHP and some of this may be because of settings my host has made, but...
With PHP it is pretty straightforward. The mail() function sends whatever you give it. So this sends a message to $email with message $msg. The string $msg can contain all the HTML tags you like. The $headers stuff is pretty obvious. There may be other options, but this one works for me.

Code:
<?php
$email = "youraddressee@somewhere.net";
$msg = "<html><font face='Arial'>This is a message generated by the Contact page of blah-blah  And this can be whatever you want</font></html>";
$subject = "Contact from your web site"; 
$headers = "MIME-Version: 1.0;\n"; 
$headers .= "Content-type: text/html; charset=iso-8859-1;\n"; 
$headers .= "From: <youremail@somewhere.net>;\n"; 
mail($email, $subject, $msg, $headers); 
?>
Hope that helps
Reply With Quote
  #3 (permalink)  
Old 06-05-2004, 03:37 PM
WebProWorld New Member
 

Join Date: Feb 2004
Location: Boston and Seattle, USA
Posts: 5
IT-guy RepRank 0
Default

Thanks. I'll have to try that. In the meantime I found a seemingly pretty good php FormM@ailer script by dbmasters (http://scripts.dbmasters.net). I set it up pretty quickly and it generates nicely formatted html emails.

Does anyone have any +/- about this script?

The one problem I have with it is that if a required field is missed by the user, after the user hits the back button all the info on the form is gone. I posted this to the author and he says that it is possible to refresh the screen but that it takes code at my end. With my prior cgi script (NMS FormMail.pl) it took care of all that. What do I have to do on my end?

Thanks!
Lee
__________________
IT and Marketing Services
www.steele-marketing.com
Reply With Quote
  #4 (permalink)  
Old 06-05-2004, 06:44 PM
paulhiles's Avatar
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: UK
Posts: 2,803
paulhiles RepRank 0
Default Moved thread

Hi Lee,

I've moved this thread from Site Design into Web Programming, there maybe members here who can answer your query on that PHP mailer script you mentioned.

Good luck,

Paul
Reply With Quote
  #5 (permalink)  
Old 06-05-2004, 07:08 PM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

Okay guys, you asked for it.
http://www.ngcoders.com/

Get EZ Mail from here :http://www.ngcoders.com/index.php?page=php

I have to get back into this PHP, I was just starting and the got sidetracked by computer troubles, but I had installed 4 scripts from these guys.
Unbelieveabe
, I mean it.

Their site is way more involved now (three months later), they've added many scripts and tutorials etc.

That EZMailer is for sendindg newsletters, for signing up for newsletters, for managing the mailing lists, it is THE REAL McCOY. All completely configureable, HTML, text, images, file attatchments, everything. It is good.
Quote:
The one problem I have with it is that if a required field is missed by the user, after the user hits the back button all the info on the form is gone
Go here - http://factor1.net/mike/mik/subdirectory1/uno.html
- it is a test page that I am working on, but use to link that says "Send a message, opens popup box".
See how you like that one for invalid input.
It is called 'Web2Mail'.
They have qa support forum : http://www.cj-design.com/?id=forum

I forgot about these guys too. I mean to support them whole heartedly, they have 'rockin' script.


As far as losing data on page loading and return, I will get something about that, I just have to find it here. It may have to do with browser caching, because it happens when using IE, but not Mozilla browsers.

For example, I use Firefox to surf this forum - WPW - instead of Internet Explorer now because I got tired of losing posts before I submitted them . I might want to open another window for a link or reference to include in the post I was making, and often when I tried to open another link with a pending forum post open, the new link would (and does) load into the WPW window I was posting with. Upon hitting the 'back' button I would find that my entire post was gone and I was staring at an empty input box again.
So I got Mozilla Firefox, and I can go open a bunch of new pages in the same window - but when I 'backtrack' to my poat, it is still there waiting to be submitted. This tells me it has to do with the browser somewhat.

I'll be back :O)
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #6 (permalink)  
Old 06-08-2004, 06:48 PM
WebProWorld Pro
 

Join Date: May 2004
Location: United Kingdom
Posts: 176
php~pro RepRank 0
Default

With loss of data from form fields on hitting the back button you dont specify if this is just an IE. 6.0 problem. Are you fixing I.E 6 bug after your session start. If it is just an IE 6 problem here is the fix. I personally have never had problems with data from form fields. The only form field that should be left blank on return is a "password" field for obvious reasons.

<?php
session_start();
header("Cache-control: private");// I.E6 fixed
?>
Reply With Quote
  #7 (permalink)  
Old 06-09-2004, 03:45 PM
WebProWorld New Member
 

Join Date: Feb 2004
Location: Boston and Seattle, USA
Posts: 5
IT-guy RepRank 0
Default you are the best

php~pro, you hit the nail on the head. I am using IE6. The two lines of code at the beginning of the script fixed the problem.

Thanks!
Lee
__________________
IT and Marketing Services
www.steele-marketing.com
Reply With Quote
  #8 (permalink)  
Old 06-09-2004, 06:13 PM
WebProWorld Pro
 

Join Date: May 2004
Location: United Kingdom
Posts: 176
php~pro RepRank 0
Default

This is a common problem for less experienced coders, yet so easily fixed. Pleased to be of help. Any more problems, post em in here/ I usually get in a couple of times per week so always happy to help out.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0