问:该域名已经绑定赠送的云邮。如何将php中的邮件设置与云邮关联起来?
linux只需要指定sendmail的路径,是不是sendmail的配置已经自动关联云邮的配置了?
现在php不能发送邮件,附上源代码:
<?php
if(!$_POST) exit;
$email = $_POST['email'];
$errors=0;
//$error[] = preg_match('/\\b[A-Z0-9._%-] @[A-Z0-9.-] \\.[A-Z]{2,4}\\b/i', $_POST['email']) ? '' : 'INVALID EMAIL ADDRESS';
if(!preg_match('/\\b[A-Z0-9._%-] @[A-Z0-9.-] \\.[A-Z]{2,4}\\b/i',$email )){
$error="Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$values = array ('name','email','message');
$required = array('name','email','message');
$your_email = "@qq.com";
$email_subject = "New Message: ".$_POST['subject'];
$email_content = "new message:\\n";
foreach($values as $key => $value){
if(in_array($value,$required)){
if ($key != 'subject' && $key != 'website') {
if( empty($_POST[$value]) ) { echo 'PLEASE FILL IN REQUIRED FIELDS'; exit; }
}
$email_content .= $value.': '.$_POST[$value]."\\n";
}
}
//echo $your_email;echo $email_subject;echo $email_content;
if(mail($your_email,$email_subject,$email_content)) {
echo 'Message sent!';
} else {
echo 'ERROR!';
}
}
?>
,linux虚机怎么设置php实现发送邮件
答:您好,1、非常抱歉给您带来不便,我司虚拟主机不支持 PHP发送邮件,请您使用STMP 发送,常见程序SMTP发送设置方法 https://www.west.cn/faq/list.asp?unid=852
2、 我司云邮SMTP 信息 https://www.west.cn/faq/list.asp?unid=2132 ,非常感谢您长期对我司的支持!
协议 | 无加密 | SSL / TSL | 服务器地址 | |
POP3 | 110 | 995 | pop3.yunyou.top | |
SMTP | 25 | 465 / 587 | smtp.yunyou.top | |
IMAP | 143 | 993 | imap.yunyou.top |