Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relay

Status
Not open for further replies.

naturalsn

Technical User
Apr 26, 2007
68
GB
Good Day

I was wondering if anyone else has maybe experienced this.
I am currently using CDO to send emails from Access and was working perfectly until yesterday i granted a user rights to send emails from the same email address as specified in my CDO Config.

I now when sending from Access get the following error

550 5.7.1 unable to relay to name@company.com

I can still send to all internal users but no external.

I have googled and noted various notes on smtp restrictions.

has anyone maybe encounter this, I am not to familiar with mail servers and just want to send email via CDO in Access.
Does anyone maybe know of something i can do to amend my exisiting code to i am currently using the following

I would really appreciate any advise

Regards
SN

Code:
Private Sub SendEmail_Click()
On Error GoTo Err_Handler

Dim strMsg As String, iIcon As Integer, StrTitle As String

Dim cdoConfig
Dim msgOne
CC = Me.CC_Address
Bcc = Me.BCC_Address
Dim strAttachment As String
strAttachment = Me.Mail_Attachment_Path


Dim ID As String

Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServerPort) = (25)
.Item(cdoSMTPServer) = "mail.company.com"
.Item(cdoSendUserName) = "me.company.com"
.Item(cdoSendPassword) = "password"

.Update
End With

Set msgOne = CreateObject("CDO.Message")
Set msgOne.Configuration = cdoConfig

msgOne.Subject = Me.Mess_Subject
msgOne.From = "me@company.com"
msgOne.To = Me.Email_Address
msgOne.TextBody = vbCrLf & vbCrLf & "Reference No: " & Me.ID & vbCrLf & vbCrLf & Me.mess_text
If Len(Bcc) > 0 Then msgOne.Bcc = Bcc
If Len(Bcc) > 0 Then msgOne.CC = CC
If Len(AddAttachment) > 0 Then msgOne.AddAttachment strAttachment
msgOne.Send

MsgBox "Email Sent Sucessfully"


  etc etc


End Sub
 
Assuming you've not changed anything since this stopped working (including your username/password for sending), I'd talk to your network admin people who run your email server - the most likely is they have placed restrictions on systems that can send to it to external addresses.

John
 
Did you get this resolved? I have recently rebuilt my Exchange server and I cannot now use the CDO method to send to external addresses. Internal is fine and I get no errors on external ones, but the email never arrives...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top