I received an email failure, why?
--index.php--
<form action="process.php" method="get">
<input type="text" name="name" id="name" value="NAME " onclick="this.value=''"/><br/>
<input type="text" name="email" id="email" value="E-MAIL " onclick="this.value=''"/>
<input type="text" name="contact" id="contact" value="CONTACT " onclick="this.value=''"/>
<select name="program" id="program" />
<option value="" selected >PROGRAM - Select - </option>
<option value="MEDICINE" >MEDICINE </option>
<option value="DENTAL" onclick="this.value=''">DENTAL </option>
<option value="PHARMACY" onclick="this.value=''">PHARMACY </option>
</select>
<select type="text" name="country" id="country" />
<option value="" selected="selected">COUNTRY - Select - </option>
<option value="RUSSIA " >RUSSIA </option>
<option value="INDONESIA " >INDONESIA </option>
<option value="INDIA " >INDIA </option>
</select>
<select type="text" name="scholarship" id="scholarship"/>
<option value="" selected="selected">SCHOLARSHIP - Select - </option>
<option value="FULL " onclick="this.value=''">FULL </option>
<option value="PARTIAL " onclick="this.value=''">PARTIAL </option>
</select>
</div>
<div class="d-blank"></div>
<div class="d-login"><input type="image" alt="Login" title="Login" src="images/icon-register-red.png" style="margin-top:210px; margin-left:-120px;"/></div>
</div>
<!-- End of Login Dialog -->
</form>
--process.php--
$name= $_GET["name开发者_运维百科"];
$email= $_GET["email"];
$contact= $_GET["contact"];
$program= $_GET["program"];
$country= $_GET["country"];
$scholarship= $_GET["scholarship"];
require_once('lib/class.phpmailer.php');
$mail = new PHPMailer(); // defaults to using php "mail()"
$mail->AddReplyTo("rusly@iconcept.com.my","Rusly-iconcept");
$mail->SetFrom('rusly@iconcept.com.my', 'Rusly-iconcept');
$mail->AddReplyTo("rusly@iconcept.com.my","Rusly-iconcept");
$address = "rusly@iconcept.com.my";
$mail->AddAddress($address, "rusly");
$mail->Subject = "RUTRA MEDIC";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->Body = "RUTRA MEDIC Scholarship Form <br><br>
Name : $name<br>
Email : $email<br>
Contact : $contact<br>
Program : $program<br>
Country : $country<br>
Scholarship : $scholarship<br>
Thank You!<br>
";
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Please Wait...!<br>
Name : $name<br>
Email : $email<br>
Contact : $contact<br>
Program : $program<br>
Country : $country<br>
Scholarship : $scholarship<br>
Thank You!<br>
";
}
?>
--error--
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:
rusly@iconcept.com.my retry time not reached for any host after a long failure period
------ This is a copy of the message, including all the headers. ------
Return-path: Received: from rutramed by coyote.ip-asia.com with local (Exim 4.69) (envelope-from ) id 1PiIXM-0005cz-W5 for rusly@iconcept.com.my; Thu, 27 Jan 2011 11:28:45 +0800 To: rusly Subject: RUTRA MEDIC X-PHP-Script: www.rutramedic.com.my/process.php for 175.144.213.43 Date: Thu, 27 Jan 2011 11:28:44 +0800 From: Rusly-iconcept Reply-to: Rusly-iconcept Message-ID: X-Priority: 3 X-Mailer: PHPMailer 5.1 (phpmailer.sourceforge.net) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="b1_e0d5b365dd6553295af0433ac71fc4c4"
--b1_e0d5b365dd6553295af0433ac71fc4c4 Content-Type: text/plain; charset = "iso-8859-1" Content-Transfer-Encoding: 8bit
To view the message, please use an HTML compatible email viewer!
--b1_e0d5b365dd6553295af0433ac71fc4c4 Content-Type: text/html; charset = "iso-8859-1" Content-Transfer-Encoding: 8bit
RUTRA MEDIC Scholarship Form
Name : MUHAMMAD HAFIZ BIN AZMI Email : www.half_peace@yahoo.com.my Contact : 014-5172017 Program : MEDICINE Country : RUSSIA Scholarship :Thank You!
--b1_e0d5b365dd6553295af0433ac71fc4c4--
$address = "rusly@iconcept.com.my";
$mail->AddAddress($address, "rusly");
According to this, $address
shouldn't be your email address, it should be $email
, and "rusly" should be $name
. I think.
$address = $email;
$mail->AddAddress($address, $name);
Try sending to a different email, such as an xxxx@gmail.com or xxxx@yahoo.com, and see if it works. You're sending it to rusly@iconcept.com.my
no matter what you put in the form, though, because you set that as a "To Address". You'll have to fix that, first. It should send to $email
, which is the email the user enters into the form.
精彩评论