-
-
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
ADD Imagens into body of message #2332
Comments
please post your code and debug output Did you check the Wiki, examples, docs, previous issues etc??? Also, a hint, the documententation on the "msgHTML" function in PHPMailer.php could prove very useful |
There is no way to guarantee that someone can see your images. All major email clients block linked images by default, and embedded images are very inefficient, and are more likely to be blocked due to content or size restrictions. Your best bet is to keep your layouts minimal and make sure they are meaningful and legible without images, and provide a link to a web version that doesn't suffer the limitations of email. |
My CODE:
|
the output, in the Gmail, its a link altered this value. But, in the BOL, it works fine |
Excuse me, why can't I send attachments because I don't have addattachment |
@2624292255 I don't understand your question, and it doesn't seem to have anything to do with this thread. |
Unable to transfer attachment |
That's not a PHPMailer error message, and I can't tell you anything about it without code and debug output. |
Class file has no function to send attachments |
Where is the attachments function? |
Right here. If you don't have that, you need to get a fresh copy of PHPMailer. Like I said, if you don't post your code or error output, I can't help. |
|
You're not checking the return value from the calls to if ($attachment) { // 添加附件
if (is_string($attachment)) {
if (is_file($attachment) && !$mail->addAttachment($attachment)) {
echo 'File attachment failed.';
}
} elseif (is_array($attachment)) {
foreach ($attachment as $file) {
if (is_file($file) && !$mail->addAttachment($file)) {
echo 'File attachment failed.';
}
}
}
} You also made a simple mistake – you used Please don't post code as images; learn to use markdown fences. Also, since you're calling |
|
if ( $ attachment ) { // 添加附件 |
See what I said about |
I've changed everything to $mail |
So check paths, permissions, and ownership of the files. If it's saying it can't read the files, it's because it can't read the files! |
Can send mail, but you can't receive attachments |
Show debug output with |
Well, yes, that's exactly as documented. PHPMailer is (deliberately) not an HTTP client, and
Fetching the file is your responsibility, not PHPMailer's. |
|
That output is not telling you much because it's telling you whether |
That wasn't my point. Use $data = file_get_contents($url);
$att = $mail->addStringAttachment('file.txt', $data);
var_dump($data, $att); |
Oops, just realised I have the arguments in the wrong order. It should be:
|
|
That says you are getting
|
You should be running 6.4.1. Always run latest versions, of everything. When I run this code: $attachment = 'https://www.ikaiyin.com/email/123.txt';
$data = file_get_contents($attachment);
$att = $mail->addStringAttachment($data, 'file.txt');
var_dump($attachment, $data, $att); I get:
|
oh my god。。。。Can I have a copy of the link? |
To PHPMailer? You're already on the site! |
This is not the latest one |
Yes it is |
OKOKOKOK、THANK YOU VERY MUCH |
How ADD Imagens into body of message whay that all navigators can see it?
For example: Gmail, Bol, etc...
Way above its not works to Gmail, but it works to BOL fine
The text was updated successfully, but these errors were encountered: