Joke Collection Website - Public benefit messages - How does javamail send a message to determine whether the message is successful? Will a receipt message be returned? The return value of the send () method is empty.
How does javamail send a message to determine whether the message is successful? Will a receipt message be returned? The return value of the send () method is empty.
Judging by catching exceptions, look at the code I wrote.
Try {
Transport. connect(SMTP, username, password);
transport . sendmessage(message,message . getallrecipients());
transport . close();
out . print(“& lt; Script Character Set =' UTF-8' > Alert ("Mail sent successfully!" ); window . history . go(- 1); & lt/script & gt; ");
} catch (message exception) {
// TODO automatically generated catch block
out . print(“& lt; Script Character Set =' UTF-8' > Alert ("Mail sending failed!" ); window . history . go(- 1); & lt/script & gt; ");
}
In this way, it can be judged whether the transmission is successful or not.
I'm also working on a javamail project recently. Welcome to discuss together.
- Related articles
- Is the credit of Shuidi credible?
- Love words for Sagittarius boys
- What does it mean to not reply to a single holiday greeting?
- How to send a short message after pressing the number in vivo phone dialer?
- What does Ali's cloud shell monitor?
- Jokes Base Camp
- How to play after iphone jailbreak?
- A short message from a poor boy proposing marriage
- Is it reliable for me to get married on a blind date in Wuxi?
- 10086 what does the acceleration package reply to?