在这里我尝试创建一个从服务器发送电子邮件的过程。在我点击按钮保存/发送后,总会出现服务器错误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>";
}
}
?>
答案 0 :(得分:0)
删除所有sharedPreference
内容。
在startActivity(intent)
之前的第一个活动中添加:
intent.putExtra("name", n);
intent.putExtra("id", i);
intent.putExtra("class", c);
在第二项活动中:
Bundle bundle = getIntent().getExtras();
String n = bundle.getString("name");
String i = bundle.getString("id");
String c = bundle.getString("class");
答案 1 :(得分:0)
您在getSharedPreferences()
活动一 - getSharedPreferences("SharedPreferencesDemo",MODE_PRIVATE)
活动二 - getSharedPreferences("SharedPreferences", MODE_PRIVATE);
尝试使用相同的名称。
更多信息here。