[Instance] JAVA calls the interface to send text and text messages. You do not need to jump to the details page.
Package com. test; import java. io. IOException; import java. io. inputStream; import
Use Java mail to send a message with a picture in HTML format, there are generally two ways to display a picture.
1. The picture exists on the server, we only need to put the picture in the server's link.
This hairstyle is simpler, but there are some drawbacks to this approach:
Images do not support offline browsing;
Each time browsing the mail needs to visit th
session class defines a basic mail conversation (sessions), which is the top-level portal class for the Java Mail API. All other classes are valid through this session. The session object obtains information, such as a mail server, user name, password, and other information that is shared throughout the application, using the Java.util.Properties object. This session class represents a message session in J
activation also run normal, should be packing problem.
See Build.xml, found in order to avoid the previous unknown problem, in Unjar all jars and packaging, removed Meta-inf, remember to avoid index.list conflict problems, but also the previous Ant bug
This should be the problem, repackage, OK
In addition, it can also be mail.send before, manually add such a paragraph
Mailcapcommandmap MC = (MAILCAPCOMMANDMAP) commandmap. Getdefaultcommandmap ();Mc. Addmailcap ("
This article for everyone to share the Java version of the JSAPI payment + Send template message related information for your reference, the specific content as follows
1. Tool class
Tools class See: Micro-Credit Payment Java version of the native payment
2. Public account setting
3. Code implementation
Openid
//Send SMS features the following is the tool class exception return 0 Send SMS failure can be result==0 to judge then return failure information If successful, return the validation code information can save session and set session time SESSION.S Etmaxinactiveinterval (60*5); Set session time post-validation can get session if the session is empty The validation code has expired or equals session, set
Use Java mail to send a message with a picture in HTML format, there are generally two ways to display a picture.
1. The picture exists on the server, we only need to put the picture in the server's link.
This hairstyle is simpler, but there are some drawbacks to this approach:
Images do not support offline browsing;
Each time browsing the mail needs to visit the
Case one:Operating Environment Comparison1, the local use of the same code, system environment and e-mail account is no problem;2, external network other server projects using the same technology is no problem;problem PhenomenonA link in the mail template (such as "http://www.baidu.com/...") is automatically executed after the mailbox is sent, causing other business errors.processing Mode 1, before processing: "http://www.baidu.com/..." This part of the string is the entire
Java uses spring Javamailsenderimpl to send messages that support plain text, attachments, HTML, velocity templatesBlog Category:
Java
Spring
This article mainly introduces the use of Javamailsenderimpl to send mail. The general
Are catching up every year, and children ask me how to send emails in Java programs, especially in HTML format, put an example here:
MAVEN introduces JavaMail
and write a simple tool class.
Package com.xxx.tools;
Import javax.mail.MessagingException;
Import javax.mail.Session;
Import Javax.mail.Transport;
Import javax.mail.internet.InternetAddress;
Import Javax.mail.internet.MimeMessage;
Solved, the problem is not the JSON format of the MSG parameter of Textmessagebody, but the GetBody method of Textmessagebody itself is problematic.Public containernodeif (!isinit ()) {This.getmsgbody (). Put ("type", Msgtype.text);This.getmsgbody (). Put ("MSG", MSG);Objectnode Jsonnode = JsonNodeFactory.instance.objectNode ();Jsonnode.put ("type", Msgtype.text);Jsonnode.put ("msg", MSG);This.getmsgbody (). Put ("msg", Jsonnode);This.setinit (TRUE);}return This.getmsgbody ();}Changed the next G
Mailsender.send (SMM);
Where Mimemessagehelper is the auxiliary class mimemessages. The above contains a resource file for the attachment to send. The normal file is sent in the following way: Java code filesystemresource file = new Filesystemresource ("c:\\users\\image1.jpg"); Helper.addinline ("file", file);
3, send mail
2 already contains the sent code, just
Today, I have nothing to worry about. on Weibo, I saw a program for sending text messages via Java. I looked at it and did not believe it. I am not sure about it. I will sort it out and may need it later.
There are several methods to send text messages via Java: (1) Use the
The following code calls the cloud communication platform text message sending in the background written in java:
Cloud communication platform api address: http://docs.cloopen.com/index.php/%E6%A8%A1%E6%9D%BF%E7%9F%AD%E4%BF%A1
Package com. msg. util; import java. io. inputStream; import
In the previous article Java email Development (II): Using JMail to send an email with illustrated text and attachments (I), we probably learned about the composition of an email.
The following is an email with the following requirements:
1. The body is a piece of html code
2. An image is embedded in the html code.
3. This email contains two attachments.
First, b
Blog Source: http://www.fhadmin.org/webnewsdetail4.htmlSystem Introduction:1. The system uses the main SSM framework JSP JSTL Bootstrap HTML5 (PC browser)2.springmvc +spring4.3.7+ mybaits3.3 SSM Common Java Web (non-maven, with pom.xml files) database: C11>mysql3. Development tools : MyEclipse Eclipse idea is available without restrictions. My side MyEclipse 2014 lead out of the project source-----------------------------------------------------------
request to the Information center, need MD5 encryption
Receiver's cell phone number.
Mobile
VARCHAR2 (11)
Not empty
11-digit Cell phone number starting with 1
SMS Content
Content
VARCHAR2 (500)
Not empty
Each English or Chinese character is 1 units, up to 500
2.2 Send text message request XML latti
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.