SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    790
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    email (javamail) not getting sent from mobile device..

    I can't understand what's happening here..

    I have a typical simple contact form... when I test in my mac, on FF or Safari, email gets sent fine..

    but on iPhone email does not get sent... I have conventional set up -- submit with submit button, action is JSP that sends email.. (I know this is not most desirable way, but it's worked fine for years, and it's for my personal website, not a lot of traffic, very few "real" emails get sent, no db involved...)

    works fine in browsers in computer, but on iPhone email does not get sent... :-(
    (I have email code inside a try-block, but no error gets printed....)

    would appreciate suggestions..

    thank you...

  2. #2
    Visible Ninja bronze trophy
    JeffWalden's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,709
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Have you confirmed that the email function in the try block is being fired? Placed some debugging messages in there?

    What about the mail server log? Do you see the mail being sent or attempting to be sent from there?

    There's nothing different (to the best of my knowledge) from the Safari browser on iOS as there is on OS X that would cause a jsp page not to load completely.
    TAKE A WALK OUTSIDE YOUR MIND.

  3. #3
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    790
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    last night I tried looking at the logs.. there are so may logs... ;-) (logs in there going back to 2010... wonder if there's a way to autom. remove old logs... )
    so I removed all logs..

    when try to send email now no logs get created (this is on Tomcat, 5.5, I think.... I have never seen specific logs just for email...)

    in addition to wrapping email code in a try-block, what other debugging code could I put in there??

    thank you....

  4. #4
    Visible Ninja bronze trophy
    JeffWalden's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,709
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Well does the email show in the logs when you successfully send it using a different browser? I ask this because maybe the action isn't being logged or your reviewing the wrong logs.

    I'm not a java developer, but I would print or echo a debugging statement, possibly stop execution inside the try block. Then attempt to load the page on your iPhone. This should confirm for you whether or not the mail function is being fired. You can debug from there.
    TAKE A WALK OUTSIDE YOUR MIND.

  5. #5
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    790
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    again, I removed all logs.. only log there now is wrapper.log, it's the same as before, has stuff in there from 2010.. nothing from 2012....

    there's only one "logs" dir in Tomcat.. all logs are there, am not aware of any logs anywhere else....

    continuing to investigate.. thank you for your help....

  6. #6
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    790
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    ok, asked my hosting guy, he said turn Tomact off and on, which I did, now see the new logs, but nothing in there about why email is not getting sent when I try sending it from iPhone...

    this is just so weird.. have tried again and again.. email gets sent when am in browser, but in iPhone, exact same contact form, same url, same code to send email.. email does not get sent (or gets sent and gets lost in the way...)

    the fact that no error from try-block prints is even more mystifying.....

    oh brother.... :-(

    thank you....

  7. #7
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    790
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    ok, this is working now.. this was very very very weird..

    I was validating first (client-side) and for some reason it wasn't connecting to the valdation.js.. I put an alert to test and then it did... I know this sounds exceedingly bizarre, but this is what it was.. for some reason the validation wasn't coming thru..

    (actually, even though I was testing at first with traditional methods, I actually connect to the server with ajax.. so am wrapping the ajax-call in an if-validate conditional, the ajax connects to the send-mail JSP (and I send params thru ajax, on success I hide the form and print ty-msg, etc), but for some very odd reason it was just not connecting to the validation.js (diff file from where ajax code is) UNTIL I put an alert in it.. then it worked.. then I removed alert, and now it works.. again, I know this sounds really really weird, but this is what happened... (am hoping it will still work tomorrow...;-)

    just one of those truly bizarre things that happen every once in a while.. that make the life of the developer so interesting.... ;-)

    thank you..

  8. #8
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    790
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    this email-sending on the mobile is turning out to be quite a handful...

    it's not sending emails from the iPhone again.....

    when I test the exact same code am using in mobile in a conventional browser, email gets sent fine, but in iPhone emails just don't get sent....
    (at least they're not arriving @ their destination.... ;-)
    (and yes, checked spam folder in gmail webmail..)

    yikes...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •