Link to home
Start Free TrialLog in
Avatar of Wheelie26
Wheelie26Flag for Australia

asked on

Access sending emails to exchange Server

I have developed an app which is used to create Reports in Word 2010 and then when the report is completed it can then be sent to the email sever either by the user select different Groups and/or users. With speacial reports (eg; Accident reports) the user has no choice as to who to email these reports are emailed to. They are automatically sent to predefined groups as determined by management. So far this app has created and emailed over 70k reports with no major hiccups. I have 120 users on the system, 73 different types of reports and 51 different email groups and users that are defined for this system. This system has been in place for 5+ years and has been stable, Until now.

I have created a new template (Word 2010) and the process of creating the report ready to be emailed off works fine. This report is to be automatically emailed and is waiting to be emailed as normal. when the User clicks on the email button the Report disappears from the screen and a success message is returned by the email  sever. The problem is that the email and attachment never gets to the users listed in the predefined group. If I change the group_ID to any other predefined group in the system, the email & attachment goes through to the users intended.

Any Ideas will be of great help

Avatar of Michael Fowler
Michael Fowler
Flag of Australia image

Some thoughts

Have you tried manually sending an email to same email addresses (or email group) as used by the code eg in outlook to test the addressing

Is this report larger than the others, possibly it is too large to be sent

Is it in docm format. Mail server could be rejecting macro enabled files
Avatar of Wheelie26


Sending an email to users/groups as used by the code ---works

Smaller report, very basic fields that need to be completed.

All reports saved as *.doc for backwards compatability

for the thoughts

Rereading your description it sounds like the problem is in the email group as it is working when other groups are selected.

Is this a mail server defined group or a list of email addresses logically grouped in the code. If the latter is this predefined or created at runtime.

Can you step through the code to check the address fields to check for errors or access exchange to check the email and the error logs?
The email group itself is setup in Exchange. All I do is pass the name of the user or group name to the Server. I have even copied the name from the address book of Exchange to ensure that the spelling is correct. This is the same process for every other report.
The error you are encountering still suggests that the problem is in the group because otherwise changing the group would not have an effect.

I would step through the code to check the address field at runtime and use a watch to capture the exact string as it is being entered so that you can use a text editor to check for additional whitespace, especially non-printable whitespace such as line returns and tabs. Notepadd++ is good for this as you can have it display these characters as symbols.
Hi Michael,

I have stepped thru the code and no errors or extra whitespaces appear.
I am using Access 2010, Word 2010, Exchange 2010 and Microsoft CDO for Windows 2000 libary to wrap & create the email package/message that I then send of to Exchange Server.
All email users are using Outlook Web App.

Then I found while searching that CDO 1.2.1 is not compatible with Outlook 2010, would this cause my problems????

Thanks for all your help
I would have thought that if that was an issue it would have broken all of the forms not just one group on one form.

What happens if assign this email group to another form?
Avatar of Wheelie26
Flag of Australia image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial