Solved

CDO Sends to some addresses, but not to others

Posted on 2013-11-19
9
314 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 83

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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 83

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
 

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 83

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 83

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Debugging Html 8 44
Domain hosting question about hiding URL 9 56
MS Exchange 2016 license 5 36
Exchange 2010 certificate warning. 5 40
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
In this video we show how to create an Accepted Domain 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 >> Ac…

710 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