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.
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.
精彩评论