Send PHP Email to Facebook Group Email

1, I tried to send an email in PHP to my Facebook group email address, but these updates are not displayed. If I send an email from my yahoo email, it will be published instantly. What information should I add to the mail header?

2, Can I add images as attachments?

My current sender code is:

<?php $to = " mygroup@groups.facebook.com "; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = " me@yahoo.com "; $headers = "From:" . $from; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?> 
+4
source share
1 answer

Do I need to send email with " me@yahoo.com "? Since Yahoo mail uses SPF , which Facebook can use to verify that your email has not really appeared, and cancel the email as an attempted spoofing.

If the email should be sent with me@yahoo.com , you will need to connect to Yahoo mail via SMTP and pass in your username and password, and legally send your email address from there.

As for image attachments, perhaps .

EDIT: According to DaveRandom's wonderful comment, the following PHP packages should make your work easier: PHPMailer or SwiftMailer

+5
source

Source: https://habr.com/ru/post/1392022/


All Articles