If you are running your app with the dev server, it does not send an
email unless you set it up to do so.

Here is what the GAE documentation says:
Using Mail
The development web server can send email for calls to the App Engine
mail service. To enable email support, the web server must be given
options that specify a mail server to use. The web server can use an
SMTP server, or it can use a local installation of Sendmail.
To enable mail support with an SMTP server, use the --smtp_host, --
smtp_port, --smtp_user and --smtp_password options with the
appropriate values.
dev_appserver.py --smtp_host=smtp.example.com --smtp_port=25 \
    --smtp_user=ajohnson --smtp_password=k1tt3ns myapp
To enable mail support with Sendmail, use the --enable_sendmail
option. The web server will use the sendmail command to send email
messages, with your installation's default configuration.
dev_appserver.py --enable_sendmail myapp
If mail is not enabled with either SMTP or Sendmail, then attempts to
send email from the application will do nothing, and appear successful
in the application.

http://code.google.com/appengine/docs/python/tools/devserver.html#Using_Mail

Thanks,
-- Mohamed D.

On Dec 12, 10:51 pm, GregD <[email protected]> wrote:
> Any help please.   I'm trying to send email from my servlet.  I
> basically copied the code from the gae site.  Im setting the from
> address as the admin of the gae account (fyi also tried a normal gmail
> account).  In the admin console its saying the mails were sent, but Im
> not seeing the email on the receiving end.  Also there are no
> exceptions being logged.  my code is below.
>
>                 Properties props = new Properties();
>                 Session session = Session.getDefaultInstance(props, null);
>
>                 StringBuffer sb = new StringBuffer();
>                 sb.append("Name: " + name);
>                 sb.append("Email: " + email);
>                 sb.append("Phone: " + phone);
>                 sb.append("Message: " + message);
>
>                 try {
>             Message msg = new MimeMessage(session);
>             msg.setFrom(new InternetAddress
> ("[email protected]"));
>             msg.setRecipient(Message.RecipientType.TO, new
> InternetAddress("[email protected]"));
>             msg.setSubject("Contact Us Website Request");
>             msg.setText(sb.toString());
>             Transport.send(msg);
>
>         } catch (Exception e) {
>             Logger log = Logger.getLogger("Greg");
>             log.severe("Sending Mail Exception");
>             log.severe(e.getMessage());
>         }

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.


Reply via email to