Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

format email sender info

Status
Not open for further replies.

itsmythg

Technical User
Apr 4, 2001
34
0
0
US
i am sending this email all is working but i want it to always send from this spcific email address. i cannot seem to get the format right.

SenderEmailAddress = myname.company@com
 
i am sending this email
How ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I thought later i should have included this, sorry.
Dim mess_body As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem

Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.BodyFormat = olFormatRichText
.SenderEmailAddress = myname@mycompany.com
.To = Me.Email_Address
.Subject = Me.Mess_Subject
.HTMLBody = "<HTML><BODY>" & _
 
Yeah, you can't do it like this as the SenderEmailAddress is a readonly property.

There may be other ways to do this (I don't think you can specify a sender that isn't a currently created outlook user, though you can create an account and log on to that to send the mail) but in the past I've used an SMTP server to accomplish this (only needed to do it once, years ago [wink]

You also mix up early and late binding in your code. If you're using the Outlook reference you don't need the CreateObject statements (of which you would only need one of each if you're using late binding) and if you're wanting to use late binding then you need to declare the appOutLook etc as Objects.

Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.

 
what about the SentOnBehalfOfName property ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Maybe the problem is what i am trying to do i am not being clear about. I have the database open on my machine but instead of the email sending from my personal work email I want the email to go out from an admin email account that i am owner of admin@mycompany.com I also need to BCC a copy to this same address as verification email was sent. that is the only piece i cannot get to work.

As always thanks for you willingness to help a beginner.
 
Log in to Outlook as that account and you will be able to send from there (as mentioned in my first post).

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.

 
I realize i can do that but since i am sending email from other admin accounts and bouncing back and forth the time wasted wouldn't gain me anything, What i am doing is changing the from box before i send, i was just wondering if it could be automated a little more.
Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top