- 的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>
";
}
?>
- 错误 -
此邮件是由邮件传递软件自动创建的。
您发送的邮件无法发送给其中一个或多个邮件 收件人。这是一个永久性错误。以下地址失败:
rusly@iconcept.com.my 长时间失效后,任何主机都没有达到重试时间
------这是邮件的副本,包括所有标题。 ------
返回路径: 收到:来自coyote.ip-asia.com与当地的rutramed(Exim 4.69) (信封来自) id 1PiIXM-0005cz-W5 对于rusly@iconcept.com.my;星期四,2011年1月27日11:28:45 +0800 To:rusly 主题:RUTRA MEDIC X-PHP-Script:www.rutramedic.com.my/process.php for 175.144.213.43 日期:星期四,2011年1月27日11:28:44 +0800 来自:Rusly-iconcept 回复:Rusly-iconcept 消息ID: X优先级:3 X-Mailer:PHPMailer 5.1(phpmailer.sourceforge.net) MIME版本:1.0 内容类型:multipart / alternative; 边界= “b1_e0d5b365dd6553295af0433ac71fc4c4”
- b1_e0d5b365dd6553295af0433ac71fc4c4 内容类型:text / plain; charset =“iso-8859-1” 内容传输编码:8位
要查看邮件,请使用HTML兼容的电子邮件查看器!
- b1_e0d5b365dd6553295af0433ac71fc4c4 内容类型:text / html; charset =“iso-8859-1” 内容传输编码:8位
谢谢!
- b1_e0d5b365dd6553295af0433ac71fc4c4 -
答案 0 :(得分:0)
$address = "rusly@iconcept.com.my";
$mail->AddAddress($address, "rusly");
根据this,$address
不应该是您的电子邮件地址,应该是$email
,而“rusly”应该是$name
。我想。
$address = $email;
$mail->AddAddress($address, $name);
尝试发送到其他电子邮件,例如xxxx@gmail.com或xxxx@yahoo.com,看看它是否有效。但是,无论你在表单中放置什么,都要将它发送到rusly@iconcept.com.my
,因为你将其设置为“To Address”。首先,你必须解决这个问题。它应该发送到$email
,这是用户输入表单的电子邮件。