SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Email Script Not Working
-
Jun 15, 2001, 12:49 #1
- Join Date
- Dec 2000
- Posts
- 528
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Email Script Not Working
Hello,
I have a script that will send an email to somebody. The form is located here. However, when I open up the email (in Outlook Express) the message is repeated twice. Why is this? You can look at the source for the form code, and here is the PHP script:PHP Code:<?php
// define following variables. if one does not apply, leave BLANK
$recipient = $recipient;
$recipientemail = $recipientemail;
$subject = $subject;
$message = $message;
$fromname = $fromname;
$fromemail = $fromemail;
// recipients
$recipient .= "$recipient <$recipientemail>";
// subject
$subject = "$subject";
// message
$message .= "$message";
// you can add a stock signature //
// to add signature, remove comments on next 2 lines
// $message .= "--\r\n"; //Signature delimiter
// $message .= "Birthday reminder copylefted by public domain";
// additional header pieces for errors, From cc's, bcc's, etc
$headers .= "From: $fromname <$fromemail>\n";
$headers .= "X-Sender: <$fromemail>\n";
$headers .= "X-Priority: 1\n"; // Urgent message!
$headers .= "Return-Path: <$fromemail>\n"; // Return path for errors
// If you want to send html mail, uncomment the following line
// $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type
// to use CC, uncomment following line
// $headers .= "cc: [email]birthdayarchive@php.net[/email]\n";
// and now mail it!
mail($recipient, $subject, $message, $headers);
?>
Any help would be appreciated.Last edited by JustForWebmasters; Jun 15, 2001 at 12:51.
Corbb O'Connor
Looking for quality website design or database programming?
Contact me for more information and a FREE quote!
-
Jun 15, 2001, 13:12 #2
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
See my comments in your code
PHP Code://Because you first assign $message to $message
$message = $message;
$fromname = $fromname;
$fromemail = $fromemail;
// recipients
$recipient .= "$recipient <$recipientemail>";
// subject
$subject = "$subject";
// then you tack on another copy of message here.
$message .= "$message";
Please don't PM me with questions.
Use the forums, that is what they are here for.
-
Jun 15, 2001, 15:16 #3
- Join Date
- Dec 2000
- Posts
- 528
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thank you, Louis.
It works now!Corbb O'Connor
Looking for quality website design or database programming?
Contact me for more information and a FREE quote!
Bookmarks