开发者

attach pictures with emails php

I want to send email with php mail function, where I can also attach two pictures (.bmp , .gif, jpg , .png, .jpeg) only from the form without storing into 开发者_开发知识库any folder of website.

I tried many scripts but nothing is working correctly.

Can you tell me how to do it?


You should not use the basic mail() function for that. Try one of the more featureful PHP classes for sending mails with attachments: PhpMailer vs. SwiftMailer?

  • Create mail object
  • Add image file as attachment.
  • Add content as HTML with image name as reference.

You need to concretise your problems when you have any. Nobody can help you with "but all is not working properly" unless you present some code and a detailed description.


If you want to do it tediously by hand, you can certainly use mail(). But it is more involving. Here are a few tutorials:

  • http://www.webcheatsheet.com/PHP/send_email_text_html_attachment.php
  • http://www.flashforum.de/forum/php-und-mysql/mail-function-content-type-multipart-mixed-152449.html
  • http://www.phpeveryday.com/articles/PHP-Email-Using-Embedded-Images-in-HTML-Email-P113.html

Please don't forget to show us your ready solution too if you really go that way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜