Solved

php email errors again...

Posted on 2003-11-26
2
236 Views
Last Modified: 2006-11-17
Hello,
i have just moved a website to a new server,,, so of course my email scripts dont work anymore.

This error is wierd, the form works if every field is filled, if any fields are blank they give the error...

this is my code

<?php

$name = $_REQUEST['name'];
$email3 = $_REQUEST['email3'];
$phone = $_REQUEST['phone'];
$workshops = $_REQUEST['workshops'];
$shiatsu = $_REQUEST['shiatsu'];
$comments = $_REQUEST['comments'];


// ********* reply email customer support ************
$msg = "E-Mail Sent From http://www.guidingrhythms.com\r\n\n";
$msg .= "Dear $name;\r\n\n";
$msg .= "We have received your email\r\n\n";

$to = $email3;  // **** to form filler ********
$subject = "guidingrhythms.com: Contact Form\r\n";
$mailheaders = "From: snjezana@guidingrhythms.com\r\n";
$mailheaders .= "Reply-To: snjezana@guidingrhythms.com";

mail($to,$subject,$msg,$mailheaders);

// ******  end of reply email *********
// ******** start of email to customer support **********

$msg = "Name : $name;\r\n";
$msg .= "Email : $email3;\r\n";
$msg .= "Phone : $'phone;\r\n";
$msg .= "Workshops : $workshops;\r\n";
$msg .= "Shiatsu : $shiatsu;\r\n";
$msg .= "Comments : $comments;\r\n";

$to = "snjezana@guidingrhythms.com"; // ** this is the customer service dept. **
$subject = "Feedback form\r\n";
$mailheaders = "From: $email3;\r\n";
$mailheaders .= "Reply-To: $email3;";

mail($to,$subject,$msg,$mailheaders);
header("Location: contact.php");
?>
0
Comment
Question by:jblayney
2 Comments
 
LVL 1

Author Comment

by:jblayney
ID: 9828338
this is the error when some fields are blank

Notice: Undefined index: workshops in \email3.php on line 6

Notice: Undefined index: shiatsu in \email3.php on line 7

Warning: mail(): SMTP server response: 503 5.5.2 Need Rcpt command. in email3.php on line 21

Warning: Cannot modify header information - headers already sent by (output started at email3.php:6) in \email3.php on line 39
0
 
LVL 13

Accepted Solution

by:
lozloz earned 25 total points
ID: 9829436
hi,

you probably want to change the level of error reporting, those errors are appearing because the requested variables are not set when they are being assigned to the variables with the name of their keys i think..

http://uk2.php.net/error_reporting

try at the top of your script: error_reporting (E_ALL ^ E_NOTICE ^ E_WARNING);

loz
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now