From: Sue on
Hi all

From MS Access 2003, I have a routine in code that automates an email. I've
tried posting in the outlook forums but no reply yet so I thought I'd try
here too...

I can autofill the To, cc, subject, body field etc but now I need to also
send
from a different user using the 'From' field. I tried adding this in the
same way to my code using:

.From

but it seems this is not a supported method? I receive an Access error 438:
Object does not support this property of method.

Please can any one tell me if this is possible and if so how to do it? If I
don't automate this, and the user has to enter the from email address
manually, it is very easy
for them to miss this and just hit send. This would result in it being
addressed as themselves, it is crucial that this does not happen as we are
sending the emails on behalf of a different company.

Thanks for your help...

Code snippets:

Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

With objEmail
.From = "Me(a)test.com"
.To = "ME-" & dist
.CC = "Me(a)test.com"
.BCC = "fred;john;jane"
.Subject = "Monthly Reports"
.Body = "Test email please ignore... "


From: Douglas J. Steele on
Can you possibly use CDONTS instead? Take a look at the simple example Tony
Toews has at http://www.granite.ab.ca/access/email/outlook.htm

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
Co-author: Access 2010 Solutions, published by Wiley
(no e-mails, please!)

"Sue" <sportybabesue(a)hotmail.co.uk> wrote in message
news:%2306OreiBLHA.3608(a)TK2MSFTNGP05.phx.gbl...
> Hi all
>
> From MS Access 2003, I have a routine in code that automates an email.
> I've tried posting in the outlook forums but no reply yet so I thought I'd
> try here too...
>
> I can autofill the To, cc, subject, body field etc but now I need to also
> send
> from a different user using the 'From' field. I tried adding this in the
> same way to my code using:
>
> .From
>
> but it seems this is not a supported method? I receive an Access error
> 438:
> Object does not support this property of method.
>
> Please can any one tell me if this is possible and if so how to do it? If
> I
> don't automate this, and the user has to enter the from email address
> manually, it is very easy
> for them to miss this and just hit send. This would result in it being
> addressed as themselves, it is crucial that this does not happen as we are
> sending the emails on behalf of a different company.
>
> Thanks for your help...
>
> Code snippets:
>
> Dim objOutlook As Outlook.Application
> Dim objEmail As Outlook.MailItem
>
> Set objOutlook = CreateObject("Outlook.application")
> Set objEmail = objOutlook.CreateItem(olMailItem)
>
> With objEmail
> .From = "Me(a)test.com"
> .To = "ME-" & dist
> .CC = "Me(a)test.com"
> .BCC = "fred;john;jane"
> .Subject = "Monthly Reports"
> .Body = "Test email please ignore... "
>


From: Sue on
Thanks for the reply Doug, I will look at this now - not heard of it before.
As long as it has the same capability (plus the From option) it might work
for me. I need to be able to view the message first to check and edit, if
required, before sending. We use MS Exchange and Office 2003 currently and
this code was the only method I was aware of for sending emails. Thanks...

"Douglas J. Steele" <NOSPAM_djsteele(a)NOSPAM_gmail.com> wrote in message
news:huinqn$nih$1(a)news.eternal-september.org...
> Can you possibly use CDONTS instead? Take a look at the simple example
> Tony Toews has at http://www.granite.ab.ca/access/email/outlook.htm
>
> --
> Doug Steele, Microsoft Access MVP
> http://www.AccessMVP.com/DJSteele
> Co-author: Access 2010 Solutions, published by Wiley
> (no e-mails, please!)
>
> "Sue" <sportybabesue(a)hotmail.co.uk> wrote in message
> news:%2306OreiBLHA.3608(a)TK2MSFTNGP05.phx.gbl...
>> Hi all
>>
>> From MS Access 2003, I have a routine in code that automates an email.
>> I've tried posting in the outlook forums but no reply yet so I thought
>> I'd try here too...
>>
>> I can autofill the To, cc, subject, body field etc but now I need to also
>> send
>> from a different user using the 'From' field. I tried adding this in the
>> same way to my code using:
>>
>> .From
>>
>> but it seems this is not a supported method? I receive an Access error
>> 438:
>> Object does not support this property of method.
>>
>> Please can any one tell me if this is possible and if so how to do it? If
>> I
>> don't automate this, and the user has to enter the from email address
>> manually, it is very easy
>> for them to miss this and just hit send. This would result in it being
>> addressed as themselves, it is crucial that this does not happen as we
>> are
>> sending the emails on behalf of a different company.
>>
>> Thanks for your help...
>>
>> Code snippets:
>>
>> Dim objOutlook As Outlook.Application
>> Dim objEmail As Outlook.MailItem
>>
>> Set objOutlook = CreateObject("Outlook.application")
>> Set objEmail = objOutlook.CreateItem(olMailItem)
>>
>> With objEmail
>> .From = "Me(a)test.com"
>> .To = "ME-" & dist
>> .CC = "Me(a)test.com"
>> .BCC = "fred;john;jane"
>> .Subject = "Monthly Reports"
>> .Body = "Test email please ignore... "
>>
>
>


From: Sue on
From what I've read so far it doesn't look as though viewing the message is
possible with CDONTS (or CDOSYS for Windows 2003 which we have). I send 3
attachments which are created via PDF from 3 Access reports and added via
code to the email, the email is also addressed to several people in the two,
cc and bcc fields. The user wants to be able to double-check that all
addresses etc are correct before sending (and currently the email body has
not been decided upon but I know I can put this on an Access form too to
collect). We could log in to a different account to send these messages but
the email address we are using is a public folder and not an actual mailbox
so this may not be possible.

I may have to just ask the user to be very careful and remember to change
the 'From' field manually before sending...


"Sue" <sportybabesue(a)hotmail.co.uk> wrote in message
news:ebrMoskBLHA.4388(a)TK2MSFTNGP04.phx.gbl...
> Thanks for the reply Doug, I will look at this now - not heard of it
> before. As long as it has the same capability (plus the From option) it
> might work for me. I need to be able to view the message first to check
> and edit, if required, before sending. We use MS Exchange and Office 2003
> currently and this code was the only method I was aware of for sending
> emails. Thanks...
>
> "Douglas J. Steele" <NOSPAM_djsteele(a)NOSPAM_gmail.com> wrote in message
> news:huinqn$nih$1(a)news.eternal-september.org...
>> Can you possibly use CDONTS instead? Take a look at the simple example
>> Tony Toews has at http://www.granite.ab.ca/access/email/outlook.htm
>>
>> --
>> Doug Steele, Microsoft Access MVP
>> http://www.AccessMVP.com/DJSteele
>> Co-author: Access 2010 Solutions, published by Wiley
>> (no e-mails, please!)
>>
>> "Sue" <sportybabesue(a)hotmail.co.uk> wrote in message
>> news:%2306OreiBLHA.3608(a)TK2MSFTNGP05.phx.gbl...
>>> Hi all
>>>
>>> From MS Access 2003, I have a routine in code that automates an email.
>>> I've tried posting in the outlook forums but no reply yet so I thought
>>> I'd try here too...
>>>
>>> I can autofill the To, cc, subject, body field etc but now I need to
>>> also send
>>> from a different user using the 'From' field. I tried adding this in the
>>> same way to my code using:
>>>
>>> .From
>>>
>>> but it seems this is not a supported method? I receive an Access error
>>> 438:
>>> Object does not support this property of method.
>>>
>>> Please can any one tell me if this is possible and if so how to do it?
>>> If I
>>> don't automate this, and the user has to enter the from email address
>>> manually, it is very easy
>>> for them to miss this and just hit send. This would result in it being
>>> addressed as themselves, it is crucial that this does not happen as we
>>> are
>>> sending the emails on behalf of a different company.
>>>
>>> Thanks for your help...
>>>
>>> Code snippets:
>>>
>>> Dim objOutlook As Outlook.Application
>>> Dim objEmail As Outlook.MailItem
>>>
>>> Set objOutlook = CreateObject("Outlook.application")
>>> Set objEmail = objOutlook.CreateItem(olMailItem)
>>>
>>> With objEmail
>>> .From = "Me(a)test.com"
>>> .To = "ME-" & dist
>>> .CC = "Me(a)test.com"
>>> .BCC = "fred;john;jane"
>>> .Subject = "Monthly Reports"
>>> .Body = "Test email please ignore... "
>>>
>>
>>
>
>