Solved

CDO Sends to some addresses, but not to others

Posted on 2013-11-19
9
300 Views
Last Modified: 2015-01-05
Hello Experts,

I have the sub-routine below.  When I pass certain addresses to strEmailTo (ie- mine), it works, but when I pass another address I get the following error

The server rejected one or more recipient addresses. The server response was: 550 Requested action not taken: mailbox unavailable or not local

I thought that the important thing here is outgoing and as you will see I have a constants for my smtp.

I think that this is a server settings, but not sure how to go about it? Yes, I have full access to my server (RMD).

Any help will be appreciated.

My code is
Function SendEmail(strEmailTo, strEmailFrom, strEmailSubject, strEmailBody, strAttach) 

	Dim objMessage 
	Dim objConf
	Dim objFlds

	Const cdoSendUsingPort = 2
	strSMTPHost = "mail.apdcompany.ca"

	Set objMessage=Server.CreateObject("CDO.Message")
	set objConf = CreateObject("CDO.Configuration") 


	Set objFlds = objConf.Fields
	With objFlds
		.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPHost
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
		.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "donotreply@abccompany.ca"
		.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "123abc"
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
		.Update
	End With

	With objMessage
		Set .Configuration = objConf
		.To = strEmailTo
		.From = strEmailFrom
		.Subject = strEmailSubject
		.HTMLBody = strEmailBody
	End With

	If strAttach <> "" Then
		objMessage.AddAttachment strAttach
	End If

	On Error Resume Next 

		objMessage.Send 
		If Err.Number <> 0 Then 
	
			Response.write(Err.Description)
			Err.Clear 
	
		End If 
	
	
	On Error Goto 0


	Set objMessage=Nothing 
	Set objConf = Nothing
	Set objFlds = Nothing

End Function

Open in new window

0
Comment
Question by:APD_Toronto
  • 4
  • 3
  • 2
9 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 250 total points
ID: 39661194
Sounds like your server is not allowing relaying to outside email addresses.  Are the failing email addresses internal or external?  How are you getting the NDR messages?  And what email server software is at "mail.apdcompany.ca"?
0
 

Author Comment

by:APD_Toronto
ID: 39661208
The outgoing email addresses are both internal, but mostly external and can be anything like @Hotmail.com, @gmail.com, @apdcompany.ca.

I am using MailEnable.
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 250 total points
ID: 39661239
If the mailbox is really available then it sounds like the domain you are sending the email to is incorrectly configured for receiving email i.e. they are not pointing their records to whoever is hosting their email server.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39661242
For Hotmail, Yahoo, Gmail, and AOL, you need to be sending from an email account that can be verified.  A "donotreply" account may not work.  They spend a lot more time trying to reject spam than delivering email.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:APD_Toronto
ID: 39661260
I really don't understand?  

I cannot configure / do an exception for all possible domains.

For example, this is for one-time purchasers for around the globe, and I have a spot where I ask, to which address to e-mail a copy of their receipt?
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39661305
Your personal emails to your friends may go thru 'easily' but email is still, after all this time, a big mess.  Spam is such a big problem that major mail servers spend something 80% of the time dealing with it.  Hotmail, Yahoo, Gmail, and AOL all rate your email 'reputation' when deciding to let you send email to their accounts.  They would prefer to bounce your email if there is any question in their 'minds'.

And believe it or not, not all mail servers use exactly the same standard for email.  The major servers have been 'tightening up' their standards as an aid to filtering out spam.  I don't think this is your situation but in one question we had, the asker was getting a bounce message saying that the methods he had been using for many years were no longer acceptable.

There is no 'answer' as such.  Remember also that spam is defined by the person or server receiving the email, spam is what they say it is.  Here is a site that says it will check your emails for free against spam indicators: http://www.emailspamtest.com/
0
 
LVL 58

Expert Comment

by:Gary
ID: 39661380
David brings up good points. Is it possible you can give us an example email?
0
 

Author Comment

by:APD_Toronto
ID: 39663390
I really don't think this is a spam issue, but rather a internal server setting on my server in delivering to external addresses
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39663558
There are many questions here similar to yours, many of them never find an answer they like.  

First, you don't decide what is spam, the receiver does.  Spam is nothing more than unwanted email.  Hotmail and Yahoo in particular are very good at rejecting email from sources that they haven't yet 'approved'.  Trouble is, no one seems to know how to get approved.  Even plain text emails can get bounced by Hotmail simply because they're never heard of your or you are sending from an email address they can't verify.
0

Featured Post

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.

Join & Write a Comment

MS outlook is a premier email client that enable you to send and receive the e-mails with various file formats of attachments such as document files, media file, and many others formats. There is some scenario occurs when a receiver of an e-mail mes…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now