[英]i cant sent email from server.?
Here i try to create a process to sent email from server..after i click button save/send, there always server error 500 appear..anyone cant help me fix it.. 在这里,我尝试创建一个从服务器发送电子邮件的过程。单击按钮“保存/发送”后,总是出现服务器错误500。.任何人都无法帮助我修复它。
<?php
include('../include/dbconn.php');
include('PHPMailer/PHPMailerAutoload.php');
require('PHPMailer/class.PHPMailer.php');
$to = $_POST['email_to'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$img = $_FILES["img"]["name"];
$from = "info@internationaltimes.com.my";
$cc = $_POST['email_cc'];
$bcc = $_POST['email_bcc'];
$headers .= "From: $from \r\n";
$headers .= "Reply-To: $from \r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
//SET EMAIL PRIORITY
//$headers .= "X-Priority: 1 (Highest)\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "Importance: High\n";
$add = mysql_query($conn, "INSERT INTO email_sent_inbox set sent_time = now(), sender = '$_POST[username]', mailto = '$_POST[email_to]', cc = '$_POST[email_cc]', bcc = '$_POST[email_bcc]', mail_subject = '$_POST[subject]', message = '$_POST[message]'" or die (mysql_error());
if($add){
$retval = mail ($to,$subject,$message,$header);
if($retval)
{
echo "<script>window.location='newsletter_blasting.php';</script>";
}
}
?>
Remove all the sharedPreference
stuff. 删除所有
sharedPreference
东西。
In the first activity before startActivity(intent)
add this: 在
startActivity(intent)
之前的第一个活动中添加以下内容:
intent.putExtra("name", n);
intent.putExtra("id", i);
intent.putExtra("class", c);
In the second activity: 在第二个活动中:
Bundle bundle = getIntent().getExtras();
String n = bundle.getString("name");
String i = bundle.getString("id");
String c = bundle.getString("class");
You are using two different names in getSharedPreferences()
您在
getSharedPreferences()
中使用了两个不同的名称
Activity one- getSharedPreferences("SharedPreferencesDemo",MODE_PRIVATE)
活动一
getSharedPreferences("SharedPreferencesDemo",MODE_PRIVATE)
Activity two- getSharedPreferences("SharedPreferences", MODE_PRIVATE);
活动二
getSharedPreferences("SharedPreferences", MODE_PRIVATE);
Try giving the same name. 尝试使用相同的名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.