Please login or register.

Login with username, password and session length

Author Topic: Yet another can't send E-mail posting  (Read 10418 times)

rolfwest

  • Newbie
  • Helpful Post Rating: 4
  • Posts: 2
Yet another can't send E-mail posting
« on: May 05, 2008, 08:22:58 PM »

I'm new to the Forum but I thought I'd weigh-in on the "won't send E-mail from MyHouse, OnAlert,...."  I've been running Smart Macros, OnAlert, and My house on-line for a couple of weeks now and of course I couldn't send E-mails from AHP.  That is, from my primary E-mail account on SBCGlobal.net.  However, I soon found out that E-mails worked from my secondary account at SprintPCS.com.  So what was the difference?  SBCGlobal.net requires authentication and SSL on port 465 and SprintPCS just uses port 25 with no authentication or SSL.

After reviewing posts on the Forum and searching the net for CreateObject("CDO.Message"), I came up with a script that works for my primary account. 

Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).
Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM


Set objMessage = CreateObject("CDO.Message")
objMessage.From = "yourname@sbcglobal.net"
objMessage.To = "whoever@sbcglobal.net"
objMessage.Subject = "ALERT - WINDOW SENSOR ALARMED"
objMessage.TextBody = "This is some sample message text.." & vbCRLF & "It was sent using SMTP authentication."


'==This section provides the configuration information for the remote SMTP server.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTP.ATT.YAHOO.com"

'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465

'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = TRUE
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "yourname@sbcglobal.net"

'Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "yourpassword"


'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

'==End remote SMTP server configuration section==

objMessage.Send

Set objMessage = Nothing

The above script works on ameritech.net, att.net, prodigy, sbcglobal, etc. - any account that used smtp.att.yahoo.com for outgoing SMTP.

I too, think this method is more robust than the AHP methods.  Appears to be faster also.

Rolf

Logged

Brian H

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 305
  • Posts: 13295
Re: Yet another can't send E-mail posting
« Reply #1 on: May 06, 2008, 06:47:34 AM »

Thank you for the information. It will be very valuable to others.
You get a helpful from me. 
Logged
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.