Page 1 of 2 12 LastLast
Results 1 to 40 of 57

Thread: smtp gmail sending error help please

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2014
    Posts
    321

    smtp gmail sending error help please

    Code:
    Private Sub SendEmail(strEmail, strEpass, strSendTo, strSubject, strTextBody, Optional strAttachment As String)
      Dim objCDOMsg As New CDO.Message
      Dim objCDOCon As New CDO.Configuration
      Dim strSchemas As String
    
      strSchemas = "http://schemas.microsoft.com/cdo/configuration/"
    
      With objCDOCon.Fields
        .Item(strSchemas & "sendusing") = 2
        .Item(strSchemas & "smtpserver") = "smtp.gmail.com"
        .Item(strSchemas & "smtpserverport") = 465
        .Item(strSchemas & "smtpauthenticate") = 1
        .Item(strSchemas & "sendusername") = strEmail  ' Your gmail
        .Item(strSchemas & "sendpassword") = strEpass ' Your password
        .Item(strSchemas & "smtpconnectiontimeout") = 30
        .Item(strSchemas & "smtpusessl") = 1
        .Update
      End With
    
      ' Construct your email
      With objCDOMsg
        .From = strEmail                 ' Your Email
        .To = strSendTo                 ' Send to any email (example: example@yahoo.com)
        .Subject = strSubject         ' Subject
        .TextBody = strTextBody   '  Body
        .Sender = strEmail             ' Your Email
        .ReplyTo = strEmail            ' Your Email
        .AddAttachment strAttachment  ' Your Attachment
        Set .Configuration = objCDOCon
        .Send                                 ' Send Email
      End With
    End Sub

    Code:
    Private Sub Command1_Click()
    SendEmail "xxxxxxx@gmail.com", "password", "zzzzzzzzz@gmail.com", "aaaaaaaaaaa", "3333333333 asasd"
    End Sub

    THIS MESSAGE COULD NOT BE SENT TO THE SMPT SERVER THE TRANSPORT ERROR CODE WAS 0X80040217

    I ADDED PROGRAMME IN FIREWALL ALSO NO ANTI FIRUS
    WINDOWS 7

  2. #2
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: smtp gmail sending error help please

    The real problem here is the isp blocking that port or at least filtering some stmp server request. You need to use your isp's smtp server.

    Note: Your ISP monitors all your internet activity, it is the one giving you access to internet.
    Last edited by Max187Boucher; Oct 28th, 2014 at 12:55 PM.

  3. #3
    New Member
    Join Date
    Oct 2014
    Posts
    5

    Re: smtp gmail sending error help please

    have you checked if smtp is enabled in your gmail account ?

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: smtp gmail sending error help please

    the code looks like it should be correct, very similar to what i have
    i doubt your isp will block port 465, though not impossible
    i believe smtp is enabled by gmail as default, but worth checking
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: smtp gmail sending error help please

    I can't get the gmail smtp to work but if i use my isp smtp server, no auth and no ssl/tls is required to send emails and it works like a charm. I could never get my gmail (with smtp enabled) to work.
    I'm with Telus (not sure if they are in the US).

  6. #6
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: smtp gmail sending error help please

    I can't get the gmail smtp to work
    in the past sometimes it works and sometimes not
    it may be that google has improved (increased) login security and now preventing this script from working
    following links, brings me to a page like, if enable is selected, maybe then it could work, i did not try

    Less secure apps

    Some devices and apps use insecure sign-in technology to access your data.

    Choosing Disable prevents these less secure devices and apps from accessing your Google Account.

    Choosing Enable increases your chances of unauthorised account access but allows you to continue using these less secure devices and apps. Learn more
    Access for less secure apps
    Disable
    Enable
    https://www.google.com/settings/security/lesssecureapps
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  7. #7
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: smtp gmail sending error help please

    Thanks westconn1

    I bookmarked the link, and I wished to test how it will work if I am logged out of Google (which is my preferred state with Google).
    After I logged in, I could not log out
    I was an Analyst in IT for 20 years, and I am getting really angry with the new breed of developers that are discarding Menus (also Start Menus, but that is another saga) (Also, I wonder if that is why I dislike simplistic Chrome ?)
    I could not find the logout on the Google page
    Could anyone shed light on that for me ?

    Thanks,
    Rob

  8. #8
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: smtp gmail sending error help please

    Could anyone shed light on that for me ?
    click the blue head and shoulders icon top right of page

    as i am always logged in to google on several devices, (hard not to be these days), i try not to use it for anything that in any way should be secure or private
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  9. #9
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: smtp gmail sending error help please

    Quote Originally Posted by westconn1 View Post
    click the blue head and shoulders icon top right of page

    as i am always logged in to google on several devices, (hard not to be these days), i try not to use it for anything that in any way should be secure or private
    Thanks, that worked but needed two head and shoulders clicks
    My FF opens a new tab most times when I click links (which I am learning to appreciate)
    In this case, my first head and shoulders click, took me to (I presume) my Google home/profile page.
    If I click the head and shoulders on that page, I only then get a pop up that lets me sign out.
    I reckon on my previous attempt, I did not reckon on the head and shoulders click, changing it's spots

    Rob
    PS I rarely use GMail, and it is always a challenge finding where the flippin options(item choices) are in there, as well.
    Last edited by Bobbles; Nov 1st, 2014 at 02:45 AM. Reason: typo

  10. #10
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: smtp gmail sending error help please

    If your tip helps the OP, I have a thought.
    Your tip appears to make the whole Google account insecure, which is nerve racking.
    Ideally it would be great if one could make (only) one of our GMails insecure.
    Assuming that is not possible, is it possible and legal / rule abiding, to create a completely separate Google account. We could make that less secure, and only use it for the sending of GMails

  11. #11
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: smtp gmail sending error help please

    Bobbles were you able to send emails with gmail once you enabled the smtp service?
    Have you tried your smtp server from your isp? You can send emails using your isp smtp and then you simply put your gmail account email as sender... No need to make your gmail insecure this way. I will try the gmail smtp once I get a chance tho and post back.

  12. #12
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: smtp gmail sending error help please

    Max,
    I must confess to not having tried any of the above YET, apart from checking out the lessening of GMail (Google) security.
    The reason that I subscribed (watched) this thread, is a friend keeps nagging me to get something working for him again, that I once created. I am watching this thread, as a fallback in case I have trouble with the approach I previously used.
    - - - DETAILS (of my previous approach)
    He had a very small business (in same state as me), but they had a server, and an external provider for his email hosting.
    I developed a fairly comprehensive solution using the free VBsendMail.
    It could embed graphics (no attachment or external links), and handled formatted text, and could attach multiple files.
    HE has since moved interstate, and has a simpler setup (no server, and just normal ISP/Telstra email provider).
    He is nagging me to get that all working again, but I am somewhat dreading, having to revisit the code, and adapting it, for three reasons -
    - At the time, it was a large task to get all that working.
    - Getting old (72), and have less neurons available
    - SMTP's (not my strong point), took a lot to get right, and it will be different now.

    Thus I am accumulating fallback plans (such as this thread)

    Rob
    PS VBSendmail is great for the price (free). It would be great if we could accumulate examples on this site ?

  13. #13
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: smtp gmail sending error help please

    VBSendmail is great for the price (free). It would be great if we could accumulate examples on this site ?
    i am sure there are many examples, in this forum

    i did a program with vbsendmail, worked fine, but changed to mainly cdo after that
    you should only need to change a few sendmail settings, mainly smtp server, username and password

    cdo will also work, usually by default, with the current isp settings
    or if gmail is a problem, you can also try gmx free email host
    neither gmail nor gmx will allow spoofing of senders email address,
    so any relpies will come back via that host, not the users normal email address host
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  14. #14
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,210

    Re: smtp gmail sending error help please

    No problems here (and no prerequisite to be logged in to Google) using cdo with smtp.gmail.com, port 465, requires Authentication, and SSL (in the UK with BT Internet isp). The beauty of using the smtp.gmail.com server is that a copy of the Sent mail appears in your gmail Sent folder; that will not happen if you use a different smtp server although you can cludge that behaviour by always sending a BCC to the your gmail address, transferring them manually to the Sent folder on receipt.
    Also no problems when Google cookies are Blocked; which is usually the way I like to keep it!
    Last edited by Magic Ink; Nov 2nd, 2014 at 09:47 AM. Reason: (and no pre...) and Also no probems ....

  15. #15
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: smtp gmail sending error help please

    I did try the gmail smtp as westconn1 said (enabled the less secure apps) and it did work my email was sent, it went to my junk folder but that's a start.

    Note:
    I used the exact same code a in Post #1... I copied and pasted it. Only had to add the Microsoft CDO reference.

  16. #16
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: smtp gmail sending error help please

    i also tested after setting less secure login
    same script i have had for several years,
    now works with less secure, fails with more secure
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  17. #17
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    557

    Re: smtp gmail sending error help please

    I am really a total noobie when it comes to sending mail with VB6. I started , just yesterday night, from some other CDO code gathered elsewhere, with no results, lot of failed transport errors.

    This morning, I tried the code the first post, it worked after changing the gmail setting to less secure, but as reported by max, the msg ended up in the recipient spam box. Can this be avoided? I understand the recipient mail client has control over what should end up in the spam box or not, but still I am surprised the sent message did end up as spam. A mail program that would send only to spam box would not be all that useful.

    And then, I have more questions because I prefer to understand more than just to past code.... but If I keep only to one : will this work with hotmail, outlook (smtp.outlook.com ???)

  18. #18
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: smtp gmail sending error help please

    I will investigate if i get time this week for hotmail/outlook but i never got hotma to work, gmail i did in the past long time ago but never hotmail. There is things you can do to stop being looked as spam/junk mail. It's all about how you write the message and make sure your "sender" email is valid (this is where the less secure might be sending email to spam/junk).
    Again I will try to investigate this also.

    Like a 2 months ago I had it figured out, using my isp smtp how not to get seen as spam/junk, but my comp got a virus and I had win8.1 so I took the apportunity to delete win8.1 as soon as I could deleting my last projects... So I lost my email project but it wasn't anything special kinda of what OP's 1st post.

  19. #19
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,176

    Re: smtp gmail sending error help please

    Gotta be ISP or firewall. "At work", the over zealous security police recently altered the firewall (or some other check) which would not allow me to connect to my gmail server (with similar code as in post #1), yet (of course) it still works "at home". If this is an 'at home' issue, then the suggestions about enabling SMTP and verifying the port to use and the others should probably correct the issue. If you are attempting at a 'work' environment, suggest you discuss this with your ISP (Internet Security POLICE).

  20. #20
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    557

    Re: smtp gmail sending error help please

    Ok... program is getting stuffy : multiple attachments, message database, address database, auto-extract e-mail addresses from any valid text files (txt, html, csv) etc).

    Hotmail, Outlook still not working....

    The server for these is : "smtp.live.com" on port 25 (587 does not work). Tries to connect for the length of the time out delay but still ends up with an invalid transport message about being not able to connect. I looked everywhere but could not find a similar option to gmail to accept "less secure messages".

  21. #21
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: smtp gmail sending error help please

    I think you might need to use their api to send emails with outlook.
    Server: smtp-mail.outlook.com
    Port: 587

  22. #22
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    557

    Re: smtp gmail sending error help please

    No... I tried the stpm-mail.outlook.com and port 587... no connect at all.....

    Been reading everywhere, all over the place, MS hotmail or outlook can not connect. Gmail always fine.

    I will give it another go, but really, don't expect much at this point.

  23. #23
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,210

    Re: smtp gmail sending error help please

    Further to my post 14 and under the same conditions;
    All working here with Hotmail using smtp.live.com, port 25, requires Authentication, and SSL.
    Outlook is an email client application part of MS Office, and or the IE browser 'Outlook.com' application which handles hotmail/msn mail. MS hosted email addresses include @hotmail addresses and @msn.com addresses (possibly others) and these can both (all) be accessed as far as I know via the smtp.live.com server.
    Outgoing emails show up in Outlook.com's Sent folder.
    Last edited by Magic Ink; Nov 3rd, 2014 at 04:53 PM. Reason: Outgoing...

  24. #24
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    557

    Re: smtp gmail sending error help please

    Nope... I tried and tried and tried.... no combination of stmp server, port etc is working. Searched Microsoft and found ExchangeCDO and ExchangeMapiCDO. That did not work either.

    Can you post your exact CDO configuration settings in code format to be sure I got everything...

    This is what I have :

    Code:
    With objCDOCon.Fields
      .Item(strSchemas & "sendusing") = 2
      .Item(strSchemas & "smtpserver") = server$                ' "smtp.live.com"
      .Item(strSchemas & "smtpserverport") = serverport         ' 25
      .Item(strSchemas & "smtpauthenticate") = 1
      .Item(strSchemas & "sendusername") = From$                ' strEmail
      .Item(strSchemas & "sendpassword") = password$            ' strEpass
      .Item(strSchemas & "smtpconnectiontimeout") = 30
      .Item(strSchemas & "smtpusessl") = 1
      .Update
    End With
    Edit : I am using one @hotmail.com, one @outlook.com, one @gmail.com adresses

    Gmail never fails, neither hotmail or outlook ever succeed
    Last edited by Navion; Nov 3rd, 2014 at 05:18 PM.

  25. #25
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,210

    Re: smtp gmail sending error help please

    Code:
    Private Function DoCDOEmail(strFrom As String, strTo As Variant, strCC As Variant, strSubject As String, strTextBody As String, Optional strBcc As String) As Boolean
    
        Dim iMsg As Object, iConf As Object, schema As String, i&
        
        MousePointer = vbHourglass
    
        Set iMsg = CreateObject("CDO.Message")
        Set iConf = CreateObject("CDO.Configuration")
        
        schema = "http://schemas.microsoft.com/cdo/configuration/"
        With iConf.Fields
            .Item(schema & "sendusing") = 2 'use a port
            .Item(schema & "smtpserver") = TbSMTPServer
            .Item(schema & "smtpserverport") = TbSMTPServerPort
            .Item(schema & "smtpauthenticate") = CheckAuthenticate.Value
            .Item(schema & "sendusername") = TbSendUserName
            .Item(schema & "sendpassword") = TbSendPassword
            .Item(schema & "smtpusessl") = CheckUseSSL.Value
            .Item(schema & "smtpconnectiontimeout") = 30    'seconds
            On Error Resume Next
            .update
        End With
        If Err.Number Then
            MsgBox "Error number " & Err.Number & ". " & Err.Description & ret & ret & _
                        "Check all settings are complete and correct on the right hand side of the dialog", vbExclamation, "Tried to configure email but ..."
            On Error GoTo 0
        Else
            On Error GoTo 0
            With iMsg
                .To = strTo
                .From = strFrom
                .CC = strCC
                .BCC = strBcc
                .Subject = strSubject
                .TextBody = strTextBody
    
                If ListAttachments.ListCount Then
                    For i = 0 To ListAttachments.ListCount - 1
                        .AddAttachment ListAttachments.List(i)
                    Next
                End If
                        
                Set .Configuration = iConf
                
                On Error Resume Next
                .Send
                If Err.Number Then
                    MsgBox "Error number " & Err.Number & ". " & Err.Description, vbExclamation, "Tried to Send email but ..."
                Else
                    DoCDOEmail = True
                    MsgBox "... sent without error", vbInformation, "Your email was .."
                End If
                On Error GoTo 0
                
            End With
        End If
             
        MousePointer = vbDefault
    
    End Function

  26. #26
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    557

    Re: smtp gmail sending error help please

    Thanks Magic Ink...

    Apart from variable names, your code equivalent to mine. I used your bit anyway.... Same results :

    2014-11-03 19:09:47 : The transport failed to connect to the server. -2147220973

    Two outgoing addresses hotmail and outlook never work
    Two outgoing addresses gmail never fail.

    The only difference is that gmail has an option to use "less secure" transactions, which is necessary.
    I could not find the equivalent option in my outlook mail box, so the equivalent feature is not set, I assume.

    Back to square one.... will inspect again outlook mailbox to find it. Have you set up such an option in your mail client?

  27. #27
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: smtp gmail sending error help please

    i vaguely remember something about having to have an advanced (paid) hotmail account to allow this to work

    the msg ended up in the recipient spam box. Can this be avoided?
    maybe, try to avoid any spoofing of email addresses or links
    sender and from should be your gmail account
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  28. #28
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,210

    Re: smtp gmail sending error help please

    re gmail - I have just checked my gmail account's "less secure" status and it is set although I cannot remember ever setting it. I think it was probably set by default.
    re Hotmail - I have never changed any defaults there

    As stated above by Westconn1, and with ref to my code, the strings in TbSendUserName and strFrom should always be the same when sending from a gmail or hotmail/msn account. The two strings may not be the same however when sending from a website/ domain based email account.
    Last edited by Magic Ink; Nov 4th, 2014 at 04:47 AM. Reason: spelling

  29. #29
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    557

    Re: smtp gmail sending error help please

    As much as I tried.... hotmail, outlook don't work.

    A searched the web extensively, only to find out reports on how CDO with hotmail and outlook have been broken for a while now. Tried all possible combinations of ports, smtp server : no go. I scrutinized the outlook mail box for info, and found, where it states, that the correct stmp server is : stmp-mail.outlook.com in port 25 (or 587). That did not work either.

    Now I had a plan for a mailing system. I would have liked to stay outlook, but gmail is the only working option. Moving much of my mail business to Gmail.

  30. #30
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    557

    Re: smtp gmail sending error help please

    I finally solved the hotmail/outlook mystery.

    It happened after a lucky google search. Now you read all reports about hotmail/outlook not working for so many people. One lucky hit made mention of port 25 being a "special" port in the sense that is it not typically open on many routers, at least in the d-link family. What surprises me is that this fact is never mentioned at all , or offered as a solution for people not being able to use CDO and outlook.

    At any rate, after forwarding the port in the router set-up, CDO-hotmail-outlook now works properly.

  31. #31
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,210

    Re: smtp gmail sending error help please

    >now works properly.
    Out of interest is that on both stmp-mail.outlook.com AND smtp.live.com servers, because I find only the latter works.

  32. #32
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    557

    Re: smtp gmail sending error help please

    Good question, especially for the answer I am about to bring. Since the outlook mail box specifically instructs the smtp-mail.outlook.com as the server to be used, that's what I set up. It worked on the first try. I did not try the smtp.live.com server server.

  33. #33
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,210

    Re: smtp gmail sending error help please

    I have been testing with a myname@msn.com style sending email address what is the domain name after the @ in yours?

    >I did not try the smtp.live.com server server.
    Just to get a more complete view, would you mind trying that?
    Last edited by Magic Ink; Nov 8th, 2014 at 07:01 AM.

  34. #34
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    557

    Re: smtp gmail sending error help please

    Quote Originally Posted by Magic Ink View Post
    Just to get a more complete view, would you mind trying that?
    I was doing just that... actually, more trouble on the horizon.

    Just a few hours ago was doing just fine... this morning : strange things are happening.

    Neither server is working on port 25... I get a long delay, no error reported, but no mail went through.

    I tried both server again on port 587 : no delay, no error, but no mail went through.

    Could both smtp-mail.outlook.com and smtp.live.com be down (at least the re-sending part?)

    G-Mail is just fine.
    Last edited by Navion; Nov 8th, 2014 at 09:35 AM. Reason: typo

  35. #35
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,210

    Re: smtp gmail sending error help please

    Port 587 never worked for me yet.
    Otherwise all working here on my previous settings of smtp.live.com (NOT smtp-live.com), requires Authentication, uses SSL, port 25, in the UK with a BTInternet isp, BTInternet HomeHub Router on default settings.

  36. #36
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    557

    Re: smtp gmail sending error help please

    Rebooted the computer, got back to the setup that did work a few hours ago. Played a little bit with the router, removed port forwarding, put it back on again. Nothing accomplished, same results as in post 34.

    The most bothering part is that before port forwarding, the .Send was returning an error. Now, no error is returned.

    It has crossed my mind that may my lucky send was from G-Mail, but no, I am sure I did send from outlook to hotmail (2 addresses).

    The plot thickens, my hopes for hotmail/outlook vanishing. Highly unreliable.

    I am not surprised that smtp-mail.outlook.com works here (or should ) and smtp.live.com is the server to use across the pond, but that does not bring me much to closure since the CDO thing seems broken again.

    Going to do a full shut-off of network, router, modem, computers and try one more time.

  37. #37
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,210

    Re: smtp gmail sending error help please

    I poked around in my router and it seems that port forwarding only affects incoming traffic, I'm no expert in such things though.
    Another good place to check port blocking may be in your Windows Firewall configuration, have you done that?
    And again re my post 33...
    I have been testing with a myname@msn.com style sending email address what is the domain name after the @ in yours?
    Last edited by Magic Ink; Nov 8th, 2014 at 10:01 AM.

  38. #38
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    557

    Re: smtp gmail sending error help please

    Nope... I am not getting anywhere..... tried every which way again and then some, all possible smtp server names, port, port forwarding, even made sure by working from a working .exe whose name matches the router port forwarding application name.

    The two MS accounts I am working with are : @hotmail.com and @outlook.com

    Microsoft say this about configuring smtp (in the outlook.com help pages):

    Serveur de courrier sortant (SMTP)
    Adresse du serveur : smtp-mail.outlook.com
    Port : 25 (ou 587 si 25 est bloqué)
    Authentification : oui
    Connexion chiffrée : TLS
    Nom d'utilisateur : votre adresse de messagerie
    Mot de passe : votre mot de passe

    Note that is says TLS here, not SSL.... I searched for TLS for the configuration (schema)... no such member
    (Microsoft says TLS supercedes SSL with more security) Again, no one mentions TLS much if at all... still a moot point ? I don't know.

    Where I stand now ? :

    - does not work ( I did succeed one single time, right after setting port forwarding, some sources mention something about first time use of port forwarding, but again, sources too scarce to make anything conclusive)

    - port 587 ruled out.. never came close of connection, throwing connection right away

    - smtp-mail.outlook.com or smtp.live.com both give the same results in the end, that is : failure... the one time I did connect though was on smtp-mail.outlook.com

    - while messing around, I screwed up error trapping (but only that), got that back at least.

    - one of the problem associated with port 25 is that it is reported it could possibly be blocked by ISP although I have no reason to be inclined to believe that is the case (in contrast, g-mail 465 is not monitored)

    - fact is g-mail always work perfect.

    - router config/setup is so incredibly confusing, I am trying not to mess things up, I think I followed safe rules properly... it just bugs me that PF worked one time but not anymore.

    - it's time to put the issue on the back burner for a while and get my life back lolll

  39. #39
    Hyperactive Member
    Join Date
    Oct 2013
    Posts
    389

    Re: smtp gmail sending error help please

    Word of advise, if it worked once, and then the exact same code, failed, over and over again.
    this usually points to closed ports, not by a hardware but rather software more likely.

    Check your firewall settings (Zonealarm for example is known to close all ports by default) \ windows firewall \ router settings.

    Try opening the mailing port (usually 25).


    i'd use http://www.canyouseeme.org/ to verify it actually opened and then go for a retry. just to be sure.

    Even though ingoing traffic should not be allowed easily on any port, and on a first glance may not look as if it's related, it's worth a try.

  40. #40
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: smtp gmail sending error help please

    It gets almost painful to see people do this sort of thing over and over:

    Code:
      strSchemas = "http://schemas.microsoft.com/cdo/configuration/"
    
      With objCDOCon.Fields
        .Item(strSchemas & "sendusing") = 2
        .Item(strSchemas & "smtpserver") = "smtp.gmail.com"
        .Item(strSchemas & "smtpserverport") = 465
        .Item(strSchemas & "smtpauthenticate") = 1
        .Item(strSchemas & "sendusername") = strEmail  ' Your gmail
        .Item(strSchemas & "sendpassword") = strEpass ' Your password
        .Item(strSchemas & "smtpconnectiontimeout") = 30
        .Item(strSchemas & "smtpusessl") = 1
        .Update
      End With
    Just set a reference to CDO, its type library has the constants predefined for all of those strings:

    Name:  sshot.png
Views: 2020
Size:  16.2 KB

    Where the habit comes from escapes me. Perhaps repeated copy/pasting of ratty old WSH scripts, where it isn't necessary even then?

Page 1 of 2 12 LastLast

Posting Permissions

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



Click Here to Expand Forum to Full Width