Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 331
  • Last Modified:

CDO Sends to some addresses, but not to others

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
APD Toronto
Asked:
APD Toronto
  • 4
  • 3
  • 2
2 Solutions
 
Dave BaldwinFixer of ProblemsCommented:
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
 
APD TorontoAuthor Commented:
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
 
GaryCommented:
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Dave BaldwinFixer of ProblemsCommented:
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
 
APD TorontoAuthor Commented:
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
 
Dave BaldwinFixer of ProblemsCommented:
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
 
GaryCommented:
David brings up good points. Is it possible you can give us an example email?
0
 
APD TorontoAuthor Commented:
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
 
Dave BaldwinFixer of ProblemsCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now