-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How to send Email with only attachment and no body? #3064
Comments
PHPMailer doesn't support arbitrary MIME structures, only a few common ones. While this makes it easy to send common text+HTML+attachments messages, it also means you don't have control for more unusual structures. You could try setting the $mail->ContentType = 'image/png';
$mail->Encoding = PHPMailer::ENCODING_BASE64;
$mail->Body = file_get_contents('my_img.png'); I'm not 100% sure that will work, but it's worth a try! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem description
I'm sending emails to an API/System.
The mail can not have multipart.
The mail should not contain a body.
Only a file attachment.
I tried allowing empty body, but it's creating multipart mail anyway.
How can I send an email with only one part that is an attachment?
I read the documentation but can not find how to do it.
The text was updated successfully, but these errors were encountered: