Emailing outside organisation

BensTooCool

New Member
Joined
Nov 18, 2014
Messages
10
Hi,

I've developed a bit of VBA that will send an email from a shared mailbox to a mailing list that is stored within an array. This process works fine except for any addresses outside my organisation. I will get this error:

1629986995290.png


If I send the email manually myself from the mailbox then it's fine, it is just whenever I try through VBA. Any ideas?

VBA CODE


Set cdoConfig = New CDO.Configuration
fileIterator = 0

With cdoConfig
.Fields(cdoSMTPServer) = "<SMTP SERVER>"
.Fields(cdoSMTPServerPort) = 25
.Fields(cdoSendUsingMethod) = cdoSendUsingPort
.Fields(cdoSMTPConnectionTimeout) = 200
.Fields.Update
End With

Set cdoMsg = New CDO.Message

With cdoMsg

Set .Configuration = cdoConfig
.From = <MAILBOX>
.Subject = <SUBJECT>
.HTMLBody = <TEXT>
.To = mailList
.Send
End With

Set cdoMsg = Nothing
Set cdoConfig = Nothing
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Sounds like permissions.
Contact your IT department and ask them if a program is allowed to email outside your organisation.
 
Upvote 0
Well the thing is, if I open up outlook and send an email outside my organisation then it goes. I just can't do it through VBA so I wasn't sure if it was a permissions thing and wanted to try and resolve it before I go down the IT department route.

I read somewhere that it could be because when you use VBA it doesn't use all the outlook headers which is why it might not be clearing security?
 
Upvote 0
If you open up Outlook you are using the permissions you personally have been assigned as a user, possibly set in Windows Group Policy.
If you use a program to send an email you are NOT using the same permissions, so they could be different.
 
Upvote 0

Forum statistics

Threads
1,215,030
Messages
6,122,762
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top