简体   繁体   English

我无法从服务器发送电子邮件。

[英]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. 尝试使用相同的名称。

More info here . 更多信息在这里

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我无法使用本地服务器在codeigniter中发送电子邮件。 帮助解决此问题 - I am unable to send email in codeigniter using Local Server. Help to resolve this issue MySQL查询问题(发送到服务器的查询数量。)? - MySQL Query Questions (number of queries sent to the server.)? 从具有不同IP的专用服务器发送的电子邮件 - Email to be sent out from a dedicated server with different IP 将文件上传到通过电子邮件发送的服务器 - Upload a file to server sent by email 无法使用 PHP 发送 email - 得到 email 发送消息,但实际上没有发送 Z0C83F57C7873A0B4AZEB EFAB2 - Cant send email using PHP - get email sent messeage but no email is sent actually 无法通过NodeMCU将POST请求发送到服务器 - Cant sent POST request to server with NodeMCU 来自电子邮件的php mail()与我通过标头发送的邮件不同 - php mail() from email not the same as what I sent through header 当请求通过Ajax发送到服务器时,我无法检索$ _COOKIE [&#39;mycookiename&#39;]的值 - I cant retrieve the value of $_COOKIE['mycookiename'] when request sent to server with ajax 从localhost发送但未在托管后发送的电子邮件? - Email sent from localhost but not sent after hosting? 无法通过Yahoo Small Business Server中的联系表发送邮件。 我需要在smtp之类的程序之前进行任何配置吗? - cant send mail through contact form in yahoo small business server. Do i need any configurations done before the program like smtp?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM