Sending Email from a specific address

G

Guest

Hello,
Is it possible to use the SendObject command, but have the email come from a
specific email address? Currently, every email that I send via the form
comes from
my default email address (I have multiple email addresses that come directly
to me) - I would like it instead to come from a generic email like
'(e-mail address removed)' I am using Outlook 2003.
Please let me know, thanks!
-gary
 
S

strive4peace

Hi Gary,

No, here are the parameters for SendObject

'SendObject
'[objecttype]
'[, objectname]
'[, outputformat]
'[, to]
'[, cc]
'[, bcc]
'[, subject]
'[, messagetext]
'[, editmessage]
'[, templatefile]

here is some code posted by Ricky Hicks for using the Outlook Reference
Library ...

'~~~~~~~~~~~`
Function MailParameters()

Dim outApp As Outlook.Application, outMsg As MailItem
Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)
With outMsg
'.Importance = olImportanceHigh
.To = Me.eMailAddress
'.CC = "CC EMAIL ADDRESS GOES HERE"
'.BCC = "BCC EMAIL ADDRESS GOES HERE"
.Subject = "YOUR SUBJECT GOES HERE"
.Body = "YOUR_E-MAIL_MESSAGE_GOES_HERE"
'.Attachments.Add _
"YOUR FILE PATH AND NAME", , , "YOUR FILES NAME"

' If you want to edit before sending
.Display
'otherwise, to just send without looking...
'.Send
End With

Set outApp = Nothing
Set outMsg = Nothing

End Function
'~~~~~~~~~~~`

using this method, there IS a SenderEmailAddress property...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
G

Guest

Hi Crystal,
Sorry I did not reply sooner to this one. First and foremost, thank you.
Second, how would I set up the sender property? I do not see it in the below
code and was hoping you might be able to help me out?
Thank you!
-gary

strive4peace said:
Hi Gary,

No, here are the parameters for SendObject

'SendObject
'[objecttype]
'[, objectname]
'[, outputformat]
'[, to]
'[, cc]
'[, bcc]
'[, subject]
'[, messagetext]
'[, editmessage]
'[, templatefile]

here is some code posted by Ricky Hicks for using the Outlook Reference
Library ...

'~~~~~~~~~~~`
Function MailParameters()

Dim outApp As Outlook.Application, outMsg As MailItem
Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)
With outMsg
'.Importance = olImportanceHigh
.To = Me.eMailAddress
'.CC = "CC EMAIL ADDRESS GOES HERE"
'.BCC = "BCC EMAIL ADDRESS GOES HERE"
.Subject = "YOUR SUBJECT GOES HERE"
.Body = "YOUR_E-MAIL_MESSAGE_GOES_HERE"
'.Attachments.Add _
"YOUR FILE PATH AND NAME", , , "YOUR FILES NAME"

' If you want to edit before sending
.Display
'otherwise, to just send without looking...
'.Send
End With

Set outApp = Nothing
Set outMsg = Nothing

End Function
'~~~~~~~~~~~`

using this method, there IS a SenderEmailAddress property...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Gary said:
Hello,
Is it possible to use the SendObject command, but have the email come from a
specific email address? Currently, every email that I send via the form
comes from
my default email address (I have multiple email addresses that come directly
to me) - I would like it instead to come from a generic email like
'(e-mail address removed)' I am using Outlook 2003.
Please let me know, thanks!
-gary
 
S

strive4peace

Hi Gary,

you're welcome

just put it in the "With" structure with everything else :)

With outMsg
'statements
.SenderEmailAddress = Me.eMailAddress
'statements
End With


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Gary said:
Hi Crystal,
Sorry I did not reply sooner to this one. First and foremost, thank you.
Second, how would I set up the sender property? I do not see it in the below
code and was hoping you might be able to help me out?
Thank you!
-gary

strive4peace said:
Hi Gary,

No, here are the parameters for SendObject

'SendObject
'[objecttype]
'[, objectname]
'[, outputformat]
'[, to]
'[, cc]
'[, bcc]
'[, subject]
'[, messagetext]
'[, editmessage]
'[, templatefile]

here is some code posted by Ricky Hicks for using the Outlook Reference
Library ...

'~~~~~~~~~~~`
Function MailParameters()

Dim outApp As Outlook.Application, outMsg As MailItem
Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)
With outMsg
'.Importance = olImportanceHigh
.To = Me.eMailAddress
'.CC = "CC EMAIL ADDRESS GOES HERE"
'.BCC = "BCC EMAIL ADDRESS GOES HERE"
.Subject = "YOUR SUBJECT GOES HERE"
.Body = "YOUR_E-MAIL_MESSAGE_GOES_HERE"
'.Attachments.Add _
"YOUR FILE PATH AND NAME", , , "YOUR FILES NAME"

' If you want to edit before sending
.Display
'otherwise, to just send without looking...
'.Send
End With

Set outApp = Nothing
Set outMsg = Nothing

End Function
'~~~~~~~~~~~`

using this method, there IS a SenderEmailAddress property...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Gary said:
Hello,
Is it possible to use the SendObject command, but have the email come from a
specific email address? Currently, every email that I send via the form
comes from
my default email address (I have multiple email addresses that come directly
to me) - I would like it instead to come from a generic email like
'(e-mail address removed)' I am using Outlook 2003.
Please let me know, thanks!
-gary
 
G

Guest

Hi Crystal,
Sorry for the lengthy delays in getting back with this. I have set up the
following function code for testing purposes:
Function MailParameters()

Dim outApp As Outlook.Application, outMsg As MailItem
Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)
With outMsg
'.Importance = olImportanceHigh
.SenderEmailAddress = Me.EmailAddress
.To = "(e-mail address removed)"
'.CC = "CC EMAIL ADDRESS GOES HERE"
'.BCC = "BCC EMAIL ADDRESS GOES HERE"
.Subject = "YOUR SUBJECT GOES HERE"
.Body = "YOUR_E-MAIL_MESSAGE_GOES_HERE"
'.Attachments.Add _
"YOUR FILE PATH AND NAME", , , "YOUR FILES NAME"
' If you want to edit before sending
.Display
'otherwise, to just send without looking...
'.Send
End With

Set outApp = Nothing
Set outMsg = Nothing

End Function

and when compiling, I get a message that the "Me" in the .SenderEmailAddress
line is invalid (compile error)
When I try to change Me.EmailAddress to a specific email address, I get the
message:
Can't assign to read-only property (compile error)
I then thought I could assign the .SenderEmailAddress as a variable, but I
get the same error message as above.
I am so sorry to be bothersome with this - any thoughts or guidance?

I have been using the SendObject command before and it is working great, but
I really need to have the emails sent from a specific address (ie,
shippingconfirmation, orderconfirmation, customerservice) depending on the
situation.

Thanks again
-gary



strive4peace said:
Hi Gary,

you're welcome

just put it in the "With" structure with everything else :)

With outMsg
'statements
.SenderEmailAddress = Me.eMailAddress
'statements
End With


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Gary said:
Hi Crystal,
Sorry I did not reply sooner to this one. First and foremost, thank you.
Second, how would I set up the sender property? I do not see it in the below
code and was hoping you might be able to help me out?
Thank you!
-gary

strive4peace said:
Hi Gary,

No, here are the parameters for SendObject

'SendObject
'[objecttype]
'[, objectname]
'[, outputformat]
'[, to]
'[, cc]
'[, bcc]
'[, subject]
'[, messagetext]
'[, editmessage]
'[, templatefile]

here is some code posted by Ricky Hicks for using the Outlook Reference
Library ...

'~~~~~~~~~~~`
Function MailParameters()

Dim outApp As Outlook.Application, outMsg As MailItem
Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)
With outMsg
'.Importance = olImportanceHigh
.To = Me.eMailAddress
'.CC = "CC EMAIL ADDRESS GOES HERE"
'.BCC = "BCC EMAIL ADDRESS GOES HERE"
.Subject = "YOUR SUBJECT GOES HERE"
.Body = "YOUR_E-MAIL_MESSAGE_GOES_HERE"
'.Attachments.Add _
"YOUR FILE PATH AND NAME", , , "YOUR FILES NAME"

' If you want to edit before sending
.Display
'otherwise, to just send without looking...
'.Send
End With

Set outApp = Nothing
Set outMsg = Nothing

End Function
'~~~~~~~~~~~`

using this method, there IS a SenderEmailAddress property...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Gary Dolliver wrote:
Hello,
Is it possible to use the SendObject command, but have the email come from a
specific email address? Currently, every email that I send via the form
comes from
my default email address (I have multiple email addresses that come directly
to me) - I would like it instead to come from a generic email like
'(e-mail address removed)' I am using Outlook 2003.
Please let me know, thanks!
-gary
 
S

strive4peace

Hi Gary,

Now it is my turn to apologize, haven't been around lately and it will
be another week or so before I get back into the saddle ... did you
figure this out or do you still want some help?


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Gary said:
Hi Crystal,
Sorry for the lengthy delays in getting back with this. I have set up the
following function code for testing purposes:
Function MailParameters()

Dim outApp As Outlook.Application, outMsg As MailItem
Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)
With outMsg
'.Importance = olImportanceHigh
.SenderEmailAddress = Me.EmailAddress
.To = "(e-mail address removed)"
'.CC = "CC EMAIL ADDRESS GOES HERE"
'.BCC = "BCC EMAIL ADDRESS GOES HERE"
.Subject = "YOUR SUBJECT GOES HERE"
.Body = "YOUR_E-MAIL_MESSAGE_GOES_HERE"
'.Attachments.Add _
"YOUR FILE PATH AND NAME", , , "YOUR FILES NAME"
' If you want to edit before sending
.Display
'otherwise, to just send without looking...
'.Send
End With

Set outApp = Nothing
Set outMsg = Nothing

End Function

and when compiling, I get a message that the "Me" in the .SenderEmailAddress
line is invalid (compile error)
When I try to change Me.EmailAddress to a specific email address, I get the
message:
Can't assign to read-only property (compile error)
I then thought I could assign the .SenderEmailAddress as a variable, but I
get the same error message as above.
I am so sorry to be bothersome with this - any thoughts or guidance?

I have been using the SendObject command before and it is working great, but
I really need to have the emails sent from a specific address (ie,
shippingconfirmation, orderconfirmation, customerservice) depending on the
situation.

Thanks again
-gary



strive4peace said:
Hi Gary,

you're welcome

just put it in the "With" structure with everything else :)

With outMsg
'statements
.SenderEmailAddress = Me.eMailAddress
'statements
End With


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Gary said:
Hi Crystal,
Sorry I did not reply sooner to this one. First and foremost, thank you.
Second, how would I set up the sender property? I do not see it in the below
code and was hoping you might be able to help me out?
Thank you!
-gary

:

Hi Gary,

No, here are the parameters for SendObject

'SendObject
'[objecttype]
'[, objectname]
'[, outputformat]
'[, to]
'[, cc]
'[, bcc]
'[, subject]
'[, messagetext]
'[, editmessage]
'[, templatefile]

here is some code posted by Ricky Hicks for using the Outlook Reference
Library ...

'~~~~~~~~~~~`
Function MailParameters()

Dim outApp As Outlook.Application, outMsg As MailItem
Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)
With outMsg
'.Importance = olImportanceHigh
.To = Me.eMailAddress
'.CC = "CC EMAIL ADDRESS GOES HERE"
'.BCC = "BCC EMAIL ADDRESS GOES HERE"
.Subject = "YOUR SUBJECT GOES HERE"
.Body = "YOUR_E-MAIL_MESSAGE_GOES_HERE"
'.Attachments.Add _
"YOUR FILE PATH AND NAME", , , "YOUR FILES NAME"

' If you want to edit before sending
.Display
'otherwise, to just send without looking...
'.Send
End With

Set outApp = Nothing
Set outMsg = Nothing

End Function
'~~~~~~~~~~~`

using this method, there IS a SenderEmailAddress property...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Gary Dolliver wrote:
Hello,
Is it possible to use the SendObject command, but have the email come from a
specific email address? Currently, every email that I send via the form
comes from
my default email address (I have multiple email addresses that come directly
to me) - I would like it instead to come from a generic email like
'(e-mail address removed)' I am using Outlook 2003.
Please let me know, thanks!
-gary
 
G

Guest

Hi Crystal,

No problem at all - I would love some help

-gary

strive4peace said:
Hi Gary,

Now it is my turn to apologize, haven't been around lately and it will
be another week or so before I get back into the saddle ... did you
figure this out or do you still want some help?


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Gary said:
Hi Crystal,
Sorry for the lengthy delays in getting back with this. I have set up the
following function code for testing purposes:
Function MailParameters()

Dim outApp As Outlook.Application, outMsg As MailItem
Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)
With outMsg
'.Importance = olImportanceHigh
.SenderEmailAddress = Me.EmailAddress
.To = "(e-mail address removed)"
'.CC = "CC EMAIL ADDRESS GOES HERE"
'.BCC = "BCC EMAIL ADDRESS GOES HERE"
.Subject = "YOUR SUBJECT GOES HERE"
.Body = "YOUR_E-MAIL_MESSAGE_GOES_HERE"
'.Attachments.Add _
"YOUR FILE PATH AND NAME", , , "YOUR FILES NAME"
' If you want to edit before sending
.Display
'otherwise, to just send without looking...
'.Send
End With

Set outApp = Nothing
Set outMsg = Nothing

End Function

and when compiling, I get a message that the "Me" in the .SenderEmailAddress
line is invalid (compile error)
When I try to change Me.EmailAddress to a specific email address, I get the
message:
Can't assign to read-only property (compile error)
I then thought I could assign the .SenderEmailAddress as a variable, but I
get the same error message as above.
I am so sorry to be bothersome with this - any thoughts or guidance?

I have been using the SendObject command before and it is working great, but
I really need to have the emails sent from a specific address (ie,
shippingconfirmation, orderconfirmation, customerservice) depending on the
situation.

Thanks again
-gary



strive4peace said:
Hi Gary,

you're welcome

just put it in the "With" structure with everything else :)

With outMsg
'statements
.SenderEmailAddress = Me.eMailAddress
'statements
End With


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Gary Dolliver wrote:
Hi Crystal,
Sorry I did not reply sooner to this one. First and foremost, thank you.
Second, how would I set up the sender property? I do not see it in the below
code and was hoping you might be able to help me out?
Thank you!
-gary

:

Hi Gary,

No, here are the parameters for SendObject

'SendObject
'[objecttype]
'[, objectname]
'[, outputformat]
'[, to]
'[, cc]
'[, bcc]
'[, subject]
'[, messagetext]
'[, editmessage]
'[, templatefile]

here is some code posted by Ricky Hicks for using the Outlook Reference
Library ...

'~~~~~~~~~~~`
Function MailParameters()

Dim outApp As Outlook.Application, outMsg As MailItem
Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)
With outMsg
'.Importance = olImportanceHigh
.To = Me.eMailAddress
'.CC = "CC EMAIL ADDRESS GOES HERE"
'.BCC = "BCC EMAIL ADDRESS GOES HERE"
.Subject = "YOUR SUBJECT GOES HERE"
.Body = "YOUR_E-MAIL_MESSAGE_GOES_HERE"
'.Attachments.Add _
"YOUR FILE PATH AND NAME", , , "YOUR FILES NAME"

' If you want to edit before sending
.Display
'otherwise, to just send without looking...
'.Send
End With

Set outApp = Nothing
Set outMsg = Nothing

End Function
'~~~~~~~~~~~`

using this method, there IS a SenderEmailAddress property...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Gary Dolliver wrote:
Hello,
Is it possible to use the SendObject command, but have the email come from a
specific email address? Currently, every email that I send via the form
comes from
my default email address (I have multiple email addresses that come directly
to me) - I would like it instead to come from a generic email like
'(e-mail address removed)' I am using Outlook 2003.
Please let me know, thanks!
-gary
 
S

strive4peace

Hi Gary,

SenderEmailAddress seems to be a read-only property in Access ... only
thing I can suggest is to changing the MAPI property it gets its value
from, PR_SENDER_EMAIL_ADDRESS ... but I can't tell you how to do that, sorry

I would suggest asking this question in the Outlook forum...



Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
G

Guest

Thank you Crystal! I appreciate the help! I will let you know if I find
anything
-gary
 
S

strive4peace

Hi Gary,

thanks, it would be nice to know how if you get it figured out ;)

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top