Ja, Sie können dies tun.
Da Sie nur oberflächliche Informationen zur Verfügung gestellt haben, wird meine Antwort von derselben Art sein.
Da Sie PHP-Code ausführen zu tun, was Sie tun, Sie eine Funktion wie
function sendMyMail($recipient, $message, $subject);
machen und es irgendwo zu implementieren. Um die Mail tatsächlich in dieser Funktion zu senden, empfehle ich PHP Mailer. Es gibt Beispiele und vieles mehr. Auf einen Hinweis: Sie benötigen einen vorhandenen SMTP-Client, sollte jede bestehende und funktionierende E-Mail-Adresse tun. Der PHP Mailer verwendet diese Mail, um Ihre Mails automatisch zu versenden. eine eigene Lösung ohne eine bestehende E-Mail Die Umsetzung wird über ein paar Wochen dauern würde ich sagen (vielleicht nicht, aber es ist wirklich kompliziert)
EDIT: Dies ist, wie ich Mails mit PHP Mailer
senden
function sendMail($recipients, $subject, $message, $altMessage)
{
if(dirname($_SERVER["PHP_SELF"]) == "/")
{
require "phpmailer/PHPMailerAutoload.php";
}
else
{
require "../phpmailer/PHPMailerAutoload.php";
}
//testXSS is a custom Function
$subject = testXSS($subject);
$message = nl2br($message);//To display line breaks in HTML
$recipients = explode(",", $recipients);//$recipients is a comma seperater string of email addresses
$amountRecipients = count($recipients);
$mail = new PHPMailer;
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = "smtp.example.com"; // Specify main and backup SMTP servers, sometimes this is also mail.example.com or something else
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = "[email protected]"; // SMTP username
$mail->Password = "SomeStrongPassword"; // SMTP password
$mail->SMTPSecure = "tls"; // Enable TLS encryption, `ssl` also accepted
$mail->Port = "a number, depending on your settings"; // TCP port to connect to
$mail->CharSet = "utf-8"; // Set charset to utf-8
$mail->setFrom("[email protected]", "NOREPLY");
for($i = 0; $i < $amountRecipients; $i++)
{
$mail->addAddress($recipients[$i]); //optional: Name as second param, not used here
}
$mail->addReplyTo("[email protected]", "Noreply");
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = "Whatever: ".$subject;
$mail->Body = $message; //Any Mail content. Can include HTML Code
$mail->AltBody = $altMessage; //If the recipient does not display HTML Mails this should not contain HTML Code
$result = ($mail->send());
if($result)
{
return 1;
}
else
{
$comment = "What went wrong";
writeToLog("DESCRIPTION", $comment);
return 0;
}
}
Was wollen Sie eigentlich mehr über meine Frage wissen, wie Sie sagten, dass es nicht ausreicht. – Karrthik
Ich meine, dass Stackoverflow keine Tutorials oder Schritt-für-Schritt-Lösungen liefern soll. Wenn Sie Code haben, der nicht funktioniert oder nicht, wie Sie es wollen, ist dies der richtige Ort für Sie. Aber wenn Sie nach einem Tutorial suchen, sind Sie besser mit Google und anderen Plattformen. Da du gefragt hast, ob es möglich ist, habe ich diese Frage beantwortet und dir Links gegeben, wo du hingehen musst, um zu dem Punkt zu kommen, den du willst. Und ich schrieb oberflächlich, nicht ausreichend :) – JRsz
okay sorry dafür, mein Schlechter. Ich habe viele Codes gesehen und ich kann nicht einmal verstehen, was sie geschrieben haben, da ich nie mit automatisierten Mails gearbeitet habe. Also habe ich dich in dieser Frage gefragt. – Karrthik