Results 1 to 27 of 27

Thread: [RESOLVED] email without mail server

Hybrid View

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

    Re: email without mail server

    What about setting up one gmail account and every copy of the program uses that hard coded to send me and email, the only variable being a text box where they type me a message. I have been trying to do something like that but I cannot make anything work.
    that is an easy solution
    only downside i know, which probably won't affect you is gmail will not allow to spoof the return address, so the return address would always be the gmail account, here is the sample code
    Code:
          Set objmessage = CreateObject("CDO.Message")
          objmessage.Subject = "Example CDO Message"
          objmessage.From = "[email protected]"
          objmessage.To = "me" ' sent to myself, not at gmail, use a valid email address
          objmessage.TextBody = "This is some sample message text."
           
           objmessage.Configuration.Fields.Item _
          ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
           
          'Name or IP of Remote SMTP Server
           
           
          'Type of authentication, NONE, Basic (Base64 encoded), NTLM
          objmessage.Configuration.Fields.Item _
          ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
          'Your UserID on the SMTP server
          objmessage.Configuration.Fields.Item _
          ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "usernm"
           
          'Your password on the SMTP server
           
          objmessage.Configuration.Fields.Item _
          ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "pass"
          objmessage.Configuration.Fields.Item _
          ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.gmx.com"
          'Server port (typically 25)
          objmessage.Configuration.Fields.Item _
          ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
          'Use SSL for the connection (False or True)
          objmessage.Configuration.Fields.Item _
          ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = false
          'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
          objmessage.Configuration.Fields.Item _
          ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
          objmessage.Configuration.Fields.Update
          objmessage.Send
          Set objmessage = Nothing 
    
    
    
    ' gmail configuration
    Set objConfig = CreateObject("cdo.configuration")
    Set Flds = objConfig.Fields
    
    schema = "http://schemas.microsoft.com/cdo/configuration/"
    Flds.Item(schema & "sendusing") = 2
    Flds.Item(schema & "smtpserver") = "smtp.gmail.com"
    Flds.Item(schema & "smtpserverport") = 465
    Flds.Item(schema & "smtpauthenticate") = 1
    Flds.Item(schema & "sendusername") = "mailaddress"
    Flds.Item(schema & "sendpassword") = "password"
    Flds.Item(schema & "smtpusessl") = 1
    Flds.Update
    
    Set objMessage.Configuration = objConfig
    this has configuration for gmail at the bottom and gmx, both are free mail servers, gmx will allow more types of attachments, gmail does not allow exe and some other types as attachments
    neither of these use the default port of 25, so is less likely to be prevented by isp blocking port 25, gmail uses ssl (secure sockets layer)
    Last edited by westconn1; Jan 13th, 2010 at 04:53 AM.
    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

  2. #2
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: email without mail server

    One other alternative which you may not want is what i have done, where the emails only get sent to me.
    I hired a renta coder that created an ocx that sends emails from my app thru
    my online jMail component on my website. I use this for users to send recommendations, and silently sending any error reports. The nice thing is they do give any email info at all. One other nice thing about this is I also receive all their computer details, app.path, OS etc
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

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