Using the JavaMail API provided by Sun, you can easily develop mail-sending programs. You may already be able to use it to send a simple text, but do you want to make your program send attachments like Outlook? After a brief introduction of JavaMail, this article explains in detail a complete messenger JavaBean and a very lightweight servlet.
(Readers without loading the JavaMail API can download to this site and set up classpath according to Readme.
defSend_mail (_user,_pwd,_to):#f = open (File_new, ' RB ') #mail_body = F.read () #f.close () #read the contents of the latest test report #with open ("H:\\as-automation\as-testcase\api_01\m66y.zip", "RB") as F: #mail_body = F.read ()msg =Mimemultipart () body= Mimetext ("Hello",'HTML','Utf-8')#Message Contentmsg['Subject'] = Header ("Automated test reports",'Utf-8')#the title of the messagemsg[' from'] =_user msg[' to'] =_to Msg.attach (body)# # #Add an attachmentAtt=mi
This code I spent a whole day to write, if reproduced, please indicate the source, thank you.
the previous article has said how to send the message body, the principle I will no longer describe, to understand the students please come here to see!
http://blog.csdn.net/lishuhuakai/article/details/27503503
Many online mail attachments to the code can not be used, so I carefully wrote a, directly packaged into a class, the need for students can directly
Send an HTML-formatted message routine with attachments
How can I send a message with an attachment and HTML format via ASP? A routine is provided below.
Response.Buffer = True
Response.Expires = 0
' Create an object instance
Set mymail = Server.CreateObject ("CDONTS. NewMail ")
' The following is what will be sent
HTML = "html = html "html = html "html = html "html = html "html = html "html = HTML "This are a test mail in htmlhtml = html
In this paper, an instance of the Codeigniter implementation send attachments in the mail. Share with you for your reference. The specific analysis are as follows:
Attach () method to you when you send an email with accessories, here is the Demo code
Copy the codeCode is as follows:
$ This-> load-> Library (email ');
$ This-> email-> from (W3 @ w3mentor.com ',' w3m ');
$ This-> email-> subject (Email Test with attachment ');
$ This->
After several days of testing, modify a few files, version 5.3 (GB) in the delete file can delete pictures and other accessories. Specifically tested the topic. Article class. The Atlas class. These several categories of
Several other categories tested the classification information only once but did not succeed.
(Expect high man to solve classified information in the deletion of the article at the same time can be the pictures and other attachments
It programmer development Essentials-all kinds of resources download list, history of the most IT resources, personal collection summary. The overall structure of the composite message
the composition relationship in MIME
analysis of hierarchical structure of compound message dividing line
Mail Organization-related APIs
The MimeMessage class represents the entire message.The MimeBodyPart class represents a MIME message for a message.The Mimemultipart class represents a combined MIME message
"We are design company, need to send a large attachment, but the company's mailbox is too not to force, the regular mailbox attachments are missing." ”
"Today need to send a solution to a customer confirmation, attachment hundred m, always upload failure, really depressing." ”
"Everyone colleagues often have documents to share, if always through the intranet transmission, the file spread efficiency is very low, sometimes do not know who sent." ”
"C
I used php to send an Email with an attachment. refer to the online article. As the saying goes, you will not copy a large copy of the article. The key is to use it for me. this is the most important thing. Let's go.
In fact, sending mail is very simple. php has ready-made functions. you can refer to the manual of php, especially the fourth example.
The key is how to combine uploaded attachments with email sending. For file upload, refer to the http:/
Use php to send emails with attachments. read the emails with attachments sent with php. refer to the online articles. As the saying goes, you will not copy a large copy of the article. The key is to use it for me. this is the most important thing. Let's talk a little bit about it. In fact, sending mail is very simple. php has ready-made functions. you can refer to the manual of php, especially the fourth e
System-Related: Win2003,iis6.0,mysql5.0,php5.2,dz X3.2,vps host, using the remote accessory features of DZ, there is no use and Pat plug-in.
Related settings: DZ background settings can upload 100M size attachments, PHP related settings have been changed very large;
Phenomenon: When uploading less than 5M attachments (not accurate numbers, just the approximate data of multiple trials), remote accessories wo
System related: win2003, IIS6.0, mysql5.0, php5.2, DZX3.2, VPS host, using the remote attachment function provided by DZ, there is no plug-in. related settings: the DZ background settings allow uploading attachments of up to MB. PHP-related settings have been greatly changed. symptom: When uploading attachments of less than 5 MB (not refined... system related: win2003, IIS6.0, mysql5.0, php5.2, DZ X3.2, VPS
CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> Forms > Form Type = "Displayform" URL = "Viewpost. aspx" Webpartzoneid = "Main" /> Form Type = "Editform" URL = "Editpost. aspx" Webpartzoneid = "Main" /> Form Type = "Newform" URL = "Newpost. aspx" Webpartzoneid = "Main" /> Forms > In this way, the newpost screen displays "Attach file" and can upload files.
Modify the view of post. aspx to display the attachment.Open post. aspx an
I often hear such a problem: I have a contract Sent from my website. How can I add an attachment to an email sent through a form? The first thing I want to talk about is that there is no simple way to do this. You must have a good understanding of PHP or other server-side scripting languages. Of course, you also need an account that truly supports PHP websites. If this premise is met, you often hear the following question: "I have a contract sent from the website. How do I give
What if I add an
I often hear this question: "I have a contract sent from my website. How do I giveWhat if I add an attachment to an email sent through a form ?"
The first thing I want to talk about is that there is no simple way to do this. You must have a good understanding of PHP or other server-side scripting languages. Of course, you also need an account that truly supports PHP websites. If this premise is met, you can use PHP to send emails with attachments afte
into a plain text file and inserts the text block after the content you write (the actual email). This, when you send everything out, the recipient's mailbox has only a plain text file-a file containing both the attachment and the actual email content.
Here is an example of an email with an attachment (an HTML file).
Return-path:Date:mon, May 2000 19:17:29 +0000From:someoneTo:personMessage-id: content-type:multipart/mixed; boundary= "396d983d6b89a"Subject:heres the Subject--396d983d6b89aContent
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.