1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Best solution to automating Gmail email sending

Discussion in 'C, C++, C#' started by xpro, Apr 4, 2012.

  1. xpro

    xpro Regular Member

    Joined:
    Jan 21, 2009
    Messages:
    416
    Likes Received:
    16
    Hello

    I usually use HTTPWebRequest for automating my apps but for Gmail a lot of javascript has to get executed inorder to get values needed for the compose message URL.

    I decided to see if I can make it work with webbrowser automation, I used Selenium2 and I was able to login and bring up the compose page, fill in the "to" and "subject" field, but typing in the message field never worked.

    Are there any solutions which I can automate this without having to engineering the Javascript they have? What about the BrowserControl in c# would that work better than Selenium2?


    Regards!
     
  2. roster67

    roster67 Registered Member

    Joined:
    Mar 27, 2012
    Messages:
    69
    Likes Received:
    10
    Why not use the standart smtp client?
     
    Last edited: Apr 4, 2012
  3. xpro

    xpro Regular Member

    Joined:
    Jan 21, 2009
    Messages:
    416
    Likes Received:
    16
    I don't want my IP to be passed in the headers.
     
  4. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,148
    Use smtp/socks proxies if you can get some.
     
  5. xpro

    xpro Regular Member

    Joined:
    Jan 21, 2009
    Messages:
    416
    Likes Received:
    16
    I don't want any IP to be passed as the site I'm targeting blocks IPs very fast. I had thousands of proxies and they are all blocked. Just trying to find a way around automating the Gmail web interface.
     
  6. roster67

    roster67 Registered Member

    Joined:
    Mar 27, 2012
    Messages:
    69
    Likes Received:
    10
    The only way i know to do this is by using private socket proxies, not public ones.
    True private socket proxies are not cheap...
     
  7. xpro

    xpro Regular Member

    Joined:
    Jan 21, 2009
    Messages:
    416
    Likes Received:
    16
    Would it be possible to use c#'s InvokeScript to bypass this issue? would that require a lot of rewriting the JS?
     
  8. ben10023

    ben10023 Regular Member

    Joined:
    Oct 23, 2011
    Messages:
    294
    Likes Received:
    62
    Location:
    UK
    Home Page:
    You may already have taken this into account, but have you tried loading it in basic HTML view?

    You can access it directly by going here http://mail.google.com/mail/h/
     
  9. xpro

    xpro Regular Member

    Joined:
    Jan 21, 2009
    Messages:
    416
    Likes Received:
    16
    I'll try that once I get home thanks. But in meanwhile I'm open to new ideas about ways of using the default Gmail interface.
     
  10. xpro

    xpro Regular Member

    Joined:
    Jan 21, 2009
    Messages:
    416
    Likes Received:
    16
    Hello

    I tried to automate Gmail account creation with Selenium2(WebDriver) but the month and gender in the page has a drop down menu created with divs. I was not able to select the month or gender. What do you guys recommend I do about this? I don't want to use httpwebrequest in this case as I have to deal with a lot of JavaScript.


    Regards!
     
  11. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,148
    Threads merged - identical/ongoing issue.
     
  12. xpro

    xpro Regular Member

    Joined:
    Jan 21, 2009
    Messages:
    416
    Likes Received:
    16
    I finally got to automate it using Slenium2 but when ever Selenium2 opens a browser and I create an account Gmail brings up the SMS page. But with Regular Firefox it does not. I have to find out what kind of footprint the Firefox opened by Webdriver is leaving and if there is anyway to remove it.
     
  13. toosmooth

    toosmooth Registered Member

    Joined:
    Feb 24, 2012
    Messages:
    77
    Likes Received:
    36
    Location:
    canada
    Okay everyone Javascript on pages suck But thankfully for us more people in the world use the little computer in there pocket more often then there personal PC. SOOO My best method to get around any javascript and automation is to put "m." infront the the webpage URL and it 95% of the time takes you to a mobile browser friendly web site(almost always javascript free). m.gmail.com brings up a hella striped down web email client. HAVE FUN :D and would love to hear your success using this method.
     
    • Thanks Thanks x 1