Solved

Sending e-mail through CDOSYS

Posted on 2011-09-03
12
743 Views
Last Modified: 2013-11-27
What does it mean if I can only send myself an e-mail through the SMTP server at my ISP and any other address gives me the error message.

"550 not permitted to relay through this server"

I'm connecting via a secure SSL connection using a valid username / address, I'm I missing something in CDO, or will this just not work at this ISP?

0
Comment
Question by:David Smithstein
  • 6
  • 5
12 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36478605
"550 not permitted to relay through this server" usually means that the 'From' address is not one of their user accounts.  Most ISPs have this policy to prevent spam.
0
 

Author Comment

by:David Smithstein
ID: 36478650
But the e-mail is "from" myself in both cases, the first is from me to me, and the one that doesn't work is from me and to some other e-mail address.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36478674
Then you may need to 'authenticate' to 'relay' email.  See the section about authentication here: http://www.powerasp.com/content/new/sending_email_cdosys.asp

My primary mail server requires me to log in and 'receive' my email before I am allowed to 'send' email.  You just have to find out what the requirements are.  What email client are you using?  What ISP?
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Assisted Solution

by:David Smithstein
David Smithstein earned 0 total points
ID: 36478773
I use bluehost.com

Here's my code, minus the username/passwords.  the connection information is out of my Outlook account settings.
=================================================================

Set objMessage = CreateObject("CDO.Message")

   
   objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
   objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "box781.bluehost.com"
   objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
   objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
   objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
   objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/authenticate") = 1
   objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "me@myemailaddress.com"
   objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"   'Your password on the SMTP server"
   
   
    objMessage.Configuration.Fields.Update
   
    objMessage.Subject = Subjct
    objMessage.From = Sender
    objMessage.To = ToList
    objMessage.TextBody = BodyTxt
   
    objMessage.Send
===========================================================
0
 

Author Comment

by:David Smithstein
ID: 36478787
What's interesting is that I can still send myself e-mail if i have the wrong password or e-mail address for authentication.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36478921
Since Bluehost does not support Windows hosting, you must be trying to send that from your home computer and that is probably the problem.  Most hosting companies will only send email out from pages on their web servers.  Being hosted on the web server itself is considered adequate authentication.
0
 

Author Comment

by:David Smithstein
ID: 36479073
Now that we know what the problem is, what's the solution?  

One of my products is a hosted .mde application on a Windows 2008 server where local Outlook configuration would be redundant with most users existing e-mail.

What is my best option to I get my SMTP/CDO code to work?
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 36479124
"where local Outlook configuration would be redundant with most users existing e-mail."  I have no idea what that means.  If you are selling a software that runs on Window Server 2008, why don't you just install IIS and the SMTP server that comes with it and send it thru that?  What are you trying to send out?

If you are trying to send out bulk email like newsletters, your problems have just barely started.  If you want to send out newsletters, most of us recommend that you use one of the bulk email services like Constant Contact to do that.  They have their own servers and spend all of their time trying to make sure that the emails go thru.  They also provide tracking info.
0
 

Author Comment

by:David Smithstein
ID: 36479157
Not newsletters, I already use Constant Contact for that.  I have a quality and material management database applilcation with an integrated e-mail module that can integrate with Outlook using MAPI on the desktop, but when I host it on Windows 2008 server, each user can access it over the web using AD on the srever for authentication and an application publishing application called RASS to open an .mde in each users AppData/Local folder connected to a comment MySQL database (about 292 tables worth)

SInce most already have a desktop Outlook installation, making them maintain another one on the server for MAPI integration isn't a good solution, hence the SMTP effort.

So i'm just enabling my users to send e-mail about needed document reviews and other quality system activities over the web.

I found IIS and the SMTP e-mail section on my server, it looks like I still need to configure SMTP server credentials, or is my server capable of being a SMTP server?  How to I configure my server to send out SMTP e-mail?
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36479177
The SMTP server that comes with IIS is a complete server.  I have used it on IIS5.1 to send email everywhere though some places will reject email from non-routeable IPs.  If you are going to send through an ISP or Exchange, you will probably need authentication and a valid email address (for that service) to send with.  I don't have IIS7 to tell you more about the setup details.  You can click on "Request Attention" above and get the IIS zones added to your question.
0
 

Author Closing Comment

by:David Smithstein
ID: 36501297
Thanks Dave, I found some instructions on the web, and will see if I can get it to work before I post under IIS.
0
 
LVL 21
ID: 36481605
I use VBA/CDO with a gmail account. The nice thing about gmail is that you get a copy of your  emails saved in your sent items folder.



0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question