不使用PHPMailer或PEAR的SMTP验证
我目前正在一个学校项目中工作,我们必须创建一个具有各种功能的大型网站,但我们不能使用任何类型的库,我想知道如何使用tls应用SMTP验证,而不使用PEAR或任何类似的东西,我目前正在尝试使用此类发送邮件 但这是徒劳的,我正在尝试创建自己的设置来验证它 我是这样测试的:不使用PHPMailer或PEAR的SMTP验证,php,email,ssl,smtp,Php,Email,Ssl,Smtp,我目前正在一个学校项目中工作,我们必须创建一个具有各种功能的大型网站,但我们不能使用任何类型的库,我想知道如何使用tls应用SMTP验证,而不使用PEAR或任何类似的东西,我目前正在尝试使用此类发送邮件 但这是徒劳的,我正在尝试创建自己的设置来验证它 我是这样测试的: <?php include_once 'private/objects/mailer/mail-handler-class.php'; $mailer = mail_handler::get_instance();
<?php
include_once 'private/objects/mailer/mail-handler-class.php';
$mailer = mail_handler::get_instance();
$mailer->set_message("<b>This is a message</b>");
$mailer->set_subject("A test message!");
$mailer->is_html();
$mailer->is_smtp();
$mailer->set_smtp_host("********");
$mailer->set_smtp_port(587); #the port
$mailer->set_smtp_auth_username("*******"); #smtp authentication username
$mailer->set_smtp_auth_password("**********"); #smtp authentication password
$mailer->set_sender("test@********.nl"); #sender
$mailer->set_receiver("********@gmail.com"); #receiver
if(!$mailer->send_mail()) {
echo "failed";
} else {
echo "sent!";
}
你的主机提供商是什么?@SumanDey我在使用transpi,我想你使用的是普通的php电子邮件脚本。如果您使用smtp,请转到phpmailer@SumanDey我不能使用phpmailer,我们不能使用任何库,因为您使用普通邮件,所以它不需要任何库或smtp。Cpanel在一小时内免费发送500封邮件。你可以用这个。