Java Reference
In-Depth Information
MIME Type
Filename Extension
text/html
htm html
image/jpeg
jpeg jpg jpe
application/pdf
pdf
image/png
png
application/rss+sml
rss
text/plain
text txt asc diff pot
image/tiff
tiff tif
image/vnd.wap.wbmp
wbmp
text/calendar
ics
text/x-vcard
vcf
The Mail service works only on deployed App Engine applications. The code in
Listing 8-12, which you'll be using in this demonstration, will not send an e-mail
running locally on the development server. You're going to use the same Eclipse
project you used for the previous examples in this chapter. Create a new Java class
called MailServlet.java . Copy the code from Listing 8-12 to the new servlet.
Listing 8-12. MailServlet.java
package com.kyleroche.gaeservices;
import java.io.IOException;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
 
Search WWH ::




Custom Search