Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

WwWXxX, udp high ports, d-link extract firmware dsl-2750u, wwwwxxxxx.2G, yxxxcom, WWWXXX, ftp://192.168.100.100, wwwxxx 100, www.xxxcon, wwwxxx

Links

XODOX
Impressum

#1: Question on SendMail object

Posted on 2008-04-21 23:39:39 by SteveB

Re: Access 2003

I have a line of code in my app that sends an email after these strings
are populated: gblSendTo, gblEMailSubject, and gblEMailBody.

DoCmd.SendObject , "", "", gblSendTo, "", "", gblEMailSubject,
gblEMailBody, False, ""

Currently, when the email is sent internally in our company, the "From:"
in the email is my own personal work address.

I did not see in the syntax (unless I missed it) where the "From:" can
be set in the "SendMail" object in Access.

There is a department address we can use as the "From".

How do I change my code so that when the users see the email sent by the
app, it shows up as
"From: <DeptName@company.com> and not from "MyName@company.com"?

Thanks.

(I don't know if this matters or not, but we useMicrosoft Exchange
Server for internal email.)



*** Sent via Developersdex http://www.developersdex.com ***

Report this message

#2: Re: Question on SendMail object

Posted on 2008-04-22 00:34:43 by Lars Brownie

I don't think this can be done with SendObject. However, you cán do it with
Outlook automation, more specifically using the .SendOnBehalfOf property,
see:

http://www.talkaboutdatabases.com/group/comp.databases.ms-ac cess/messages/887159.html

Lars

"RLN" <nospam@devdex.com> schreef in bericht
news:1208813425_120@news.newsfeeds.com...
> Re: Access 2003
>
> I have a line of code in my app that sends an email after these strings
> are populated: gblSendTo, gblEMailSubject, and gblEMailBody.
>
> DoCmd.SendObject , "", "", gblSendTo, "", "", gblEMailSubject,
> gblEMailBody, False, ""
>
> Currently, when the email is sent internally in our company, the "From:"
> in the email is my own personal work address.
>
> I did not see in the syntax (unless I missed it) where the "From:" can
> be set in the "SendMail" object in Access.
>
> There is a department address we can use as the "From".
>
> How do I change my code so that when the users see the email sent by the
> app, it shows up as
> "From: <DeptName@company.com> and not from "MyName@company.com"?
>
> Thanks.
>
> (I don't know if this matters or not, but we useMicrosoft Exchange
> Server for internal email.)
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***

Report this message

#3: Re: Question on SendMail object

Posted on 2008-04-24 18:13:43 by RLN

Thank you for this tip here. I am going to try the code from the link
you provided.

I am somewhat new to using the Outlook Object model inside of an Access
app. If you have any tips or good coding practices for using this this
specific object model efficiently, I would welcome your suggestions.

I read in another thread where "SendOnBehalfOf" has a permission that
has to be granted. Where is this set/modified?

In my Access app, the "From" address must change before the email is
sent, only if the current record in the database came from a source
different than the previous record.


*** Sent via Developersdex http://www.developersdex.com ***

Report this message

#4: Re: Question on SendMail object

Posted on 2008-04-24 18:28:44 by Lyle Fairfield

RLN <nospamrln@devdex.com> wrote in news:1209053070_367@news.newsfeeds.com:

> I am somewhat new to using the Outlook Object model inside of an Access
> app. If you have any tips or good coding practices for using this this
> specific object model efficiently, I would welcome your suggestions.

I suggest that you use CDO.

Report this message

#5: Re: Question on SendMail object

Posted on 2008-04-24 20:18:43 by Lars Brownie

"RLN" <nospamrln@devdex.com> schreef in bericht
news:1209053070_367@news.newsfeeds.com...
>
> Thank you for this tip here. I am going to try the code from the link
> you provided.
>
> I am somewhat new to using the Outlook Object model inside of an Access
> app. If you have any tips or good coding practices for using this this
> specific object model efficiently, I would welcome your suggestions.

To use it you must make sure that the Outlook reference in Access is
checked.

> I read in another thread where "SendOnBehalfOf" has a permission that
> has to be granted. Where is this set/modified?

In the exchange server the users should have send-as rights on the
department mailbox.

> In my Access app, the "From" address must change before the email is
> sent, only if the current record in the database came from a source
> different than the previous record.

In your code you can set the SendOnBehalfOf property or not set it at all on
the basis of the criteria you mention.

Lars

Report this message

#6: Re: Question on SendMail object

Posted on 2008-04-24 20:59:47 by Tony Toews

"Lars Brownie" <lars@brownie.com> wrote:

>To use it you must make sure that the Outlook reference in Access is
>checked.

However, given that folks may have different versions of Outlook installed or maybe
not even have it installed, I'd suggest switching your code to late binding once it's
working.

Late binding means you can safely remove the reference and only have an error when
the app executes lines of code in question. Rather than erroring out while starting
up the app and not allowing the users in the app at all. Or when hitting a mid, left
or trim function call.

For more information including additional text and some detailed links see the "Late
Binding in Microsoft Access" page at http://www.granite.ab.ca/access/latebinding.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/

Report this message

#7: Re: Question on SendMail object

Posted on 2008-04-24 21:07:53 by Lars Brownie

Thanks for the tip. Didn't know about that.

"Tony Toews [MVP]" <ttoews@telusplanet.net> schreef in bericht
news:q2m11455fcdqeqqloi7lnqiturhc633924@4ax.com...
> "Lars Brownie" <lars@brownie.com> wrote:
>
>>To use it you must make sure that the Outlook reference in Access is
>>checked.
>
> However, given that folks may have different versions of Outlook installed
> or maybe
> not even have it installed, I'd suggest switching your code to late
> binding once it's
> working.
>
> Late binding means you can safely remove the reference and only have an
> error when
> the app executes lines of code in question. Rather than erroring out
> while starting
> up the app and not allowing the users in the app at all. Or when hitting
> a mid, left
> or trim function call.
>
> For more information including additional text and some detailed links see
> the "Late
> Binding in Microsoft Access" page at
> http://www.granite.ab.ca/access/latebinding.htm
>
> Tony
> --
> Tony Toews, Microsoft Access MVP
> Please respond only in the newsgroups so that others can
> read the entire thread of messages.
> Microsoft Access Links, Hints, Tips & Accounting Systems at
> http://www.granite.ab.ca/accsmstr.htm
> Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/

Report this message