Sending a email using an account setup for the process sending the

Status
Not open for further replies.
Q

Q3liZXJ3b2xm

I have an access database that sends emails out on a regular basis. It was

decided to keep track of these emails, that a new exchange account should be

setup. I am not trying how to figure out how to send and email through that

account. I would imagine it would require signing into this account before

send the email and then logging out of it. I have not been able to find any

coding samples to do this.

We are using a mix of Outlook 2003 and 2007 so it would probably have to be

done with late binding or writing code to see which version is on the

particular machine sending the email

Cyberwolf

Finder of Paths, Hunter of Prey

Ghost of the Night, Shadow of Day

The Wolf

Office 2003 SP3 on Win XP Pro SP2 using outlook 2003 & 2007.
 
S

SvenC

Hi Cyberwolf,


> I have an access database that sends emails out on a regular basis. It
> was
> decided to keep track of these emails, that a new exchange account should
> be
> setup. I am not trying how to figure out how to send and email through
> that
> account. I would imagine it would require signing into this account
> before
> send the email and then logging out of it. I have not been able to find
> any
> coding samples to do this.

> We are using a mix of Outlook 2003 and 2007 so it would probably have to
> be
> done with late binding or writing code to see which version is on the
> particular machine sending the email


How are you currently sending the mails?

How does that sending solution set the sender address of the mails?

If the sender does not matter for the recipients you could just keep your

current solution and add the new Exchange mailbox as BCC recipient.

SvenC
 
Q

Q3liZXJ3b2xm

Re: Sending a email using an account setup for the process sending

currently we are having a problem where some of the useres are on the OWA

version, and I am getting Outlook installed on their pc's. But we would also

like to see the email being sent from that account. That way we can track

any outgoing emails easily to see what time it was actually sent out

according to the sent folder.

Cyberwolf

Finder of Paths, Hunter of Prey

Ghost of the Night, Shadow of Day

The Wolf

"SvenC" wrote:


> Hi Cyberwolf,
>
> > I have an access database that sends emails out on a regular basis. It
> > was
> > decided to keep track of these emails, that a new exchange account should
> > be
> > setup. I am not trying how to figure out how to send and email through
> > that
> > account. I would imagine it would require signing into this account
> > before
> > send the email and then logging out of it. I have not been able to find
> > any
> > coding samples to do this.
> > We are using a mix of Outlook 2003 and 2007 so it would probably have to
> > be
> > done with late binding or writing code to see which version is on the
> > particular machine sending the email


> How are you currently sending the mails?
> How does that sending solution set the sender address of the mails?

> If the sender does not matter for the recipients you could just keep your
> current solution and add the new Exchange mailbox as BCC recipient.

> > SvenC

>
 
S

SvenC

Re: Sending a email using an account setup for the process sending

"Cyberwolf" <Cyberwolf> wrote in message

news:49C0FF5B-7386-487A-BCAA-745CD3ECC1D4@microsoft.com...
> currently we are having a problem where some of the useres are on the OWA
> version, and I am getting Outlook installed on their pc's. But we would
> also
> like to see the email being sent from that account. That way we can track
> any outgoing emails easily to see what time it was actually sent out
> according to the sent folder.


Again: how do you currently send those mails. Maybe you can

change your current approach which could cause less trouble

than searching a completely new way.

Sending mails automatically with the Outlook Object Model

will typically cause security dialog pop ups which is obviously

not good for an automatic process.

SvenC
 
Q

Q3liZXJ3b2xm

Re: Sending a email using an account setup for the process sending

Currently I am using htis code to send emails with pdf attachements

Const oMailItem As Long = 0

Public Function SendMail(DisplayMsg As Boolean, strTo As String, strSubject

As String, strBody As String, Optional strAttachPathFile As String, Optional

strCC As String, Optional strBCC As String)

Dim objOutlook As Object

Dim objOutlookMsg As Object

Dim objOutlookRecip As Object

Dim objOutlookAttach As Object

'Dim objOutlook As Outlook.Application

'Dim objOutlookMsg As Outlook.MailItem

'Dim objOutlookRecip As Outlook.Recipient

'Dim objOutlookAttach As Outlook.Attachment

'Dim oOutlook As Object

'Dim omail As Object

'Set oOutlook = CreateObject("Outlook.Application")

'Set omail = oOutlook.CreateItem(olMailItem)

Set objOutlook = CreateObject("Outlook.Application")

Set objOutlookMsg = objOutlook.CreateItem(oMailItem)

With objOutlookMsg

'Add "To" recipient

'Set objOutlookRecip = .Recipients.Add(strTo)

'objOutlookRecip.Type = olTo

> To = strTo

'.SentOnBehalfOfName = "RAMP"

'"Add "CC" recipient

If strCC <> "" Then

> CC = strCC

End If

'Add "BCC" recipient

If strBCC <> "" Then

> .BCC = strBCC

End If

'Add subject, body, and importance of the E-Mail Messzage

objOutlookMsg.Subject = strSubject

objOutlookMsg.Body = strBody

'objOutlookMsg.Importance =

'Add Attachment

If strAttachPathFile <> "" Then

objOutlookMsg.Attachments.Add strAttachPathFile, 1

' .Attachments.Add (strAttachPathFile)

End If

For Each objOutlookRecip In .Recipients

objOutlookRecip.Resolve

If Not objOutlookRecip.Resolve Then

objOutlookMsg.Display

End If

Next objOutlookRecip

objOutlookMsg.Send

End With

Set objOutlookMsg = Nothing

objOutlook.Quit

Set objOutlook = Nothing

End Function

I was hoping to modifiy this code to suit my needs

Cyberwolf

Finder of Paths, Hunter of Prey

Ghost of the Night, Shadow of Day

The Wolf

"SvenC" wrote:


> "Cyberwolf" <Cyberwolf> wrote in message
> news:49C0FF5B-7386-487A-BCAA-745CD3ECC1D4@microsoft.com...
> > currently we are having a problem where some of the useres are on the OWA
> > version, and I am getting Outlook installed on their pc's. But we would
> > also
> > like to see the email being sent from that account. That way we can track
> > any outgoing emails easily to see what time it was actually sent out
> > according to the sent folder.


> Again: how do you currently send those mails. Maybe you can
> change your current approach which could cause less trouble
> than searching a completely new way.

> Sending mails automatically with the Outlook Object Model
> will typically cause security dialog pop ups which is obviously
> not good for an automatic process.

> > SvenC

>
 
S

SvenC

Re: Sending a email using an account setup for the process sending

Hi Cyberwolf,


> Currently I am using htis code to send emails with pdf attachements



> ...
> .To = strTo
> '.SentOnBehalfOfName = "RAMP"
> '"Add "CC" recipient
> If strCC <> "" Then
> .CC = strCC
> End If
> I was hoping to modifiy this code to suit my needs


So is it important to you that your new special mailbox is seen as

the sender or do you just need a mailbox which gets a copy of your

automatically sent items?

If a copy is enough: just add the special mailbox as .CC or .BCC.

If you need to "send as" that new mailbox and the code is running

on the client machines with the client accounts then you need to

give all clients "send-as" rights to that special mailbox. That can be

quite some work for your admins - not sure if that is worth it.

And I am not sure if the Outlook Object Model allows to change

sender property if you have the send-as right.

Might be a question for Ken or Sue?

SvenC
 
Q

Q3liZXJ3b2xm

Re: Sending a email using an account setup for the process sending

Basically we would need to set the group email up on the pc's that need it

and then I control which account the mail is sent from through my code, using

something like .sentonbehalfof?

Cyberwolf

Finder of Paths, Hunter of Prey

Ghost of the Night, Shadow of Day

The Wolf

"SvenC" wrote:


> Hi Cyberwolf,
>
> > Currently I am using htis code to send emails with pdf attachements

>
> >...
> > .To = strTo
> > '.SentOnBehalfOfName = "RAMP"
> > '"Add "CC" recipient
> > If strCC <> "" Then
> > .CC = strCC
> > End If
> > I was hoping to modifiy this code to suit my needs


> So is it important to you that your new special mailbox is seen as
> the sender or do you just need a mailbox which gets a copy of your
> automatically sent items?

> If a copy is enough: just add the special mailbox as .CC or .BCC.

> If you need to "send as" that new mailbox and the code is running
> on the client machines with the client accounts then you need to
> give all clients "send-as" rights to that special mailbox. That can be
> quite some work for your admins - not sure if that is worth it.

> And I am not sure if the Outlook Object Model allows to change
> sender property if you have the send-as right.

> Might be a question for Ken or Sue?

> > SvenC
>
 
K

Ken Slovak - [MVP - Outlook]

Re: Sending a email using an account setup for the process sending

If the logged in user has Send As permissions for the target sending mailbox

then setting SentOnBehalfOfName() will do what you want. Set that property

to the email address of the mailbox alias and send the item.

"Cyberwolf" <Cyberwolf> wrote in message

news:CC1D5361-075F-4C65-8CB6-2798C141BBC2@microsoft.com...
> Basically we would need to set the group email up on the pc's that need it
> and then I control which account the mail is sent from through my code,
> using
> something like .sentonbehalfof?

> > Cyberwolf
> Finder of Paths, Hunter of Prey
> Ghost of the Night, Shadow of Day
> The Wolf
 
Q

Q3liZXJ3b2xm

RESOLVED: Re: Sending a email using an account setup

Thanks Ken.

Cyberwolf

Finder of Paths, Hunter of Prey

Ghost of the Night, Shadow of Day

The Wolf
wrote:


> If the logged in user has Send As permissions for the target sending mailbox
> then setting SentOnBehalfOfName() will do what you want. Set that property
> to the email address of the mailbox alias and send the item.

> >

>

> "Cyberwolf" <Cyberwolf> wrote in message
> news:CC1D5361-075F-4C65-8CB6-2798C141BBC2@microsoft.com...
> > Basically we would need to set the group email up on the pc's that need it
> > and then I control which account the mail is sent from through my code,
> > using
> > something like .sentonbehalfof?
> > > > Cyberwolf
> > Finder of Paths, Hunter of Prey
> > Ghost of the Night, Shadow of Day
> > The Wolf


>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
T Sending One Email to Trigger Another Being Sent Using an Email within the 1st? Using Outlook 0
S Sending Email from Access 2007 through Outlook 2007 using template Outlook VBA and Custom Forms 13
R Sending email using VB6 Outlook VBA and Custom Forms 1
S Sending automatic email from Access using Outlook Outlook VBA and Custom Forms 1
P Sending email from outlook IMAP to GMAIL where embedded images are added as attachment Using Outlook 1
D Sending email from Office 365 alias in Outlook Using Outlook 3
B Outlook 2003 email sending & receiving suddenly stopped working Using Outlook 3
HarvMan Hotmail - Sending email is undeliverable Using Outlook 4
D Adding Enterprise Exchange Email Account to Outlook Prevents Sending via Outlook.com Account Using Outlook.com accounts in Outlook 10
B When sending an email, I am showing 2 of my address's Using Outlook 1
M Auto expand Distribution List Before Sending Email Outlook VBA and Custom Forms 1
A Check for words in subject header before sending email Outlook VBA and Custom Forms 4
O Run macro automatically at sending an email Using Outlook 11
H Select Specific Account When Sending Email, Based on Current Folder Outlook VBA and Custom Forms 1
M Help sending email but removing signature via VBA Outlook VBA and Custom Forms 5
C address book "when sending email" bug? Using Outlook 0
R Sending email copy (*.msg file) of sent email if subject line contains specific string. Outlook VBA and Custom Forms 1
C replace subject line generated by converting a word document to PDF and sending it to an email Using Outlook 8
A Sending Emails Through Outlook From Multiple Email Addresses Using Outlook 1
X Delay sending an email until the next working day (public holidays) Outlook VBA and Custom Forms 0
P Outlook 2010 sending safe senders email to junk box Using Outlook 8
Diane Poremsky Warn before sending messages to the wrong email address Using Outlook 1
Dilshad VBA editor opens when sending an email Using Outlook 2
Diane Poremsky Sending Email from a Secondary Exchange Mailbox Using Outlook 0
Diane Poremsky Sending Email from a Secondary Exchange Mailbox Using Outlook 0
rohit I want to Populate Popup box while sending any email with attachment. Outlook VBA and Custom Forms 4
rohit I want to Populate Popup box while sending any email with attachment Using Outlook 1
J Is there a way to disallow sending from certain addresses to specific email addresses? Using Outlook 2
M Sending Excel Charts in the Body of an Email Using Outlook 1
A Application_ItemSend not accessed when sending email outside outlook (i.e. word or send to mail from Using Outlook 7
P Desktop Outlook not sending from alternative email Using Outlook.com accounts in Outlook 6
A After receiving the same email 3 times, Outlook starts sending it to junk Using Outlook 1
R Outlook not responding when sending email Using Outlook 1
I How to prevent exchange email account from sending emails in Outlook Using Outlook 4
X Outlook 2003 not sending all of the new email message Using Outlook 1
O Choosing Sending Email Address from Word Using Outlook 5
P VBA for Dialog Box when sending Email Using Outlook 8
C email sending window won't go away even after email has sent Exchange Server Administration 2
M Outlook 2010 stuck in Work Offline mode; trouble sending email Using Outlook 1
S Changing "from" address when sending email Using Outlook 4
N Prompt for password when sending an email Exchange Server Administration 1
K How to split large email when sending Using Outlook 1
L Sending from a distribution list email Using Outlook 6
P Delayed mass email sending Using Outlook 2
M Links prevent sending email Using Outlook 3
A Send Email to Task while sending to Email address Outlook VBA and Custom Forms 1
S Email Help: Sending Outlook email from Excel VBA Outlook VBA and Custom Forms 6
R Sending a copy of an incoming email to a network folder Outlook VBA and Custom Forms 1
T Emails - sending and receiving multiple copies of the same email Using Outlook 4
C Prevent Outlook from sending an email with a blank Subject Line Outlook VBA and Custom Forms 3

Similar threads

Top