You can be cool and write a method using this https://www.php.net/manual/en/ref.imap.php
在debianoid上,您可以尝试以下操作:
apt install libphp-phpmailer
it will install you the PHPmailer class from ( https://github.com/PHPMailer/PHPMailer )
我认为我从那里为您复制代码没有意义...
我做了一个超级简单的版本
//PHPMailer Object
$mail = new PHPMailer;
//From email address and name
$mail->From = "from@yourdomain.com";
$mail->FromName = "Full Name";
//To address
$mail->addAddress("recepient1@example.com");
//CC and BCC
$mail->addCC("cc@example.com");
$mail->addBCC("bcc@example.com");
//Send HTML or Plain Text email
$mail->isHTML(true);
$mail->Subject = "Subject Text";
$mail->Body = "Mail body in HTML";
$mail->AltBody = "This is the plain text version of the email content";
$mail->send();