0

共有サーバーでメールを送信しようとしています。私のエラーページは

 <br />
<b>Warning</b>:  mail() [<a href='function.mail'>function.mail</a>]: SMTP server response: 452 4.3.1 Out of memory in <b>D:\hshome\......\form.php</b> on line <b>21</b><br />
email didnt send
<META HTTP-EQUIV ="Refresh" CONTENT =" 1; URL= Thank.html" /> 

これはform.phpです

<?php 
include ("config.php");   
$mail_check=true; 
if(trim($_POST["name"])=="") 
    $mail_check=false; 
if(trim($_POST["email"])=="") 
    $mail_check=false; 
if(trim($_POST["subject"])=="") 
    $mail_check=false; 

if($mail_check){ 
    $to=$config["email"]; 
    $subject = $_POST["subject"]; 
    $message = '<html><head><title>$lang["newemailarriveed"]</title></head><body> 
    test
    </body></html>'; 
    $headers  = 'MIME-Version: 1.0' . "\r\n"; 
    $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n"; 
    $headers .= 'From: '.$_POST["name"].' <'.$_POST["email"].'>' . "\r\n"; 

    if(mail($to, $subject, $message, $headers)){ 
        echo $lang["success"]; 
    } 
    else{ 
        echo $lang["eror1"]; 
    } 
}else{ 
    echo $lang["eror2"]; 
} 
?>

その間config.php_

<?php 
// ServCombina
// Contact Form By TalGarty 
    $config = Array( 
        "email" => "info@example.com", 
        );         

    $lang = Array( 
        "newemailarriveed" => "new mail", 
        "newemailfrom" => "from", 
        "info" => "detail", 
        "fullname" => "name", 
        "iemail" => "email", 
        "phone" => "phone", 
        "success" => "success", 
        "eror1" => "email didnt send", 
        "eror2" => "one or more of the fields are empty", 
        );         
?> 

*これはWindows共有サーバー上にあります

私はあまりPHPを知らないと言わざるを得ません.私は電子メールを送信しようとしましたが、うまくいきました.mにasp.net移動することはできません.asp.netphp

asp.net次のコードで動作します:

String s_name = "", s_email = "", s_phone = "";
if (name != null && name.Text != null) { s_name = name.Text; }    
if (email != null && email.Text != null) { s_email = email.Text; }
if (phone != null && phone.Text != null) { s_phone = phone.Text; }

MailMessage mailMessage = new MailMessage();
mailMessage.To.Add("example@example.com");
mailMessage.From = new MailAddress("info@example.com");
mailMessage.Subject = "test";
mailMessage.Body = @"<!DOCTYPE html> "+
                    "<html  xmlns=\"http://www.w3.org/1999/xhtml\"><head><title>new email</title></head><body> " +
                    "test" +
                    "</body></html>"; 
SmtpClient smtpClient = new SmtpClient("mail.example.com");
smtpClient.Send(mailMessage);
Response.Redirect("~/aaa/Thank.html");
4

2 に答える 2

1

解決:

ファイルの先頭に次の行を追加します。

   ini_set('SMTP','mail.example.com');
   ini_set('sendmail_from','info@example.com');

ini_set('memory_limit','32M');役に立たなかったので、ファイルに入れませんでした

于 2013-10-01T11:20:11.377 に答える