A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

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



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 29th 09, 01:27 PM posted to microsoft.public.outlook.program_vba
Cyberwolf
external usenet poster
 
Posts: 5
Default Sending a email using an account setup for the process sending the

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.
Ads
  #2  
Old May 29th 09, 01:47 PM posted to microsoft.public.outlook.program_vba
SvenC[_2_]
external usenet poster
 
Posts: 40
Default Sending a email using an account setup for the process sending the

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

  #3  
Old May 29th 09, 02:54 PM posted to microsoft.public.outlook.program_vba
Cyberwolf
external usenet poster
 
Posts: 5
Default 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


  #4  
Old May 29th 09, 03:10 PM posted to microsoft.public.outlook.program_vba
SvenC[_2_]
external usenet poster
 
Posts: 40
Default Sending a email using an account setup for the process sending

"Cyberwolf" wrote in message
...
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

  #5  
Old May 29th 09, 03:24 PM posted to microsoft.public.outlook.program_vba
Cyberwolf
external usenet poster
 
Posts: 5
Default 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" wrote in message
...
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


  #6  
Old May 29th 09, 03:51 PM posted to microsoft.public.outlook.program_vba
SvenC[_2_]
external usenet poster
 
Posts: 40
Default 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
  #7  
Old May 29th 09, 04:12 PM posted to microsoft.public.outlook.program_vba
Cyberwolf
external usenet poster
 
Posts: 5
Default 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

  #8  
Old May 29th 09, 07:10 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Cyberwolf" wrote in message
...
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


  #9  
Old May 29th 09, 07:26 PM posted to microsoft.public.outlook.program_vba
Cyberwolf
external usenet poster
 
Posts: 5
Default RESOLVED: 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


"Ken Slovak - [MVP - Outlook]" 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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Cyberwolf" wrote in message
...
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



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending a test email to sender's own account. Henry Outlook and VBA 2 May 11th 09 04:12 AM
Choose the email account when sending emails via VBA Catalin Outlook and VBA 4 January 14th 08 06:47 PM
Help with sending email through my AOL account [email protected] Outlook Express 1 November 9th 06 08:06 PM
Outlook needs sending rule that lets you specify email account Davemac1 Outlook - Using Contacts 14 October 13th 06 06:57 PM
Weekly Email Sending Process cclemay Outlook and VBA 1 February 15th 06 09:38 PM


All times are GMT +1. The time now is 02:41 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.