Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post

    SMTP server question

    Hello

    I have the following code to 'tell a friend' about your site via an email form:

    Code:
    Set ObjSendMail = CreateObject("CDO.Message")
    
    'This section provides the configuration information for the remote SMTP server. 
    
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network). 
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="relay-hosting.secureserver.net" 
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False) 
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 
    
    ' If server requires outgoing authentication uncomment lines below
     
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 basic (clear-text) authentication 
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="my_siteemail.com" 
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="my_password" 
    
    ObjSendMail.Configuration.Fields.Update 
    
    End remote SMTP server configuration section== 
    ObjSendMail.To = friendmail
    ObjSendMail.Subject = friendname & ", check this out."
    ObjSendMail.From = fromname & "@mywebsite.com"
    
    
    ObjSendMail.TextBody= msgBody
    ObjSendMail.Send
    
    
    Set ObjSendMail = Nothing
    Response.Redirect "www.my_site.com"
    %>
    I am not sure where my smtpserver (as in "smtp.my_site.com") should be placed in the above code.

    Any advice, please?

    Steve

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,650
    Thanks
    80
    Thanked 4,638 Times in 4,600 Posts
    ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="relay-hosting.secureserver.net"

    That line is specifying the SMTP server for GoDaddy.com, by the way. (That's why the name of the fidd is "/smtpserver".)

    If you aren't on GoDaddy, change it as appropriate.

    For *MOST* SMTP servers, you only need the first 3 of those configuration settings and you should *NOT* then specify the others.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post
    That's great Master Pedant - thank you.

    Cheers.


  •  

    Posting Permissions

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