简体   繁体   中英

Picture in the email send by script

Good morning. This is my first post so please forgive me for any mistakes. I am using PHPMailer for sending emails and it works perfect. However... I created php script which does a select query on SQL Server DB and sends email to users with reminder. If I run this script directly from browser, emails with embedded picture are sent without problems, but if I run this php file using .bat file emails are sent without a picture - just red cross in place where the picture should be. To attach a picture I am using:

$mail->AddEmbeddedImage("images/logo.jpg","logo","logo.jpg")

and in the email body:

<img src="cid:logo">

Any ideas why a picture is not attached when php is ran from the bat file? thanks LukaszKU

您应该指定图像的完整路径,例如:/ /usr/home/user/.../images/logo.png

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM