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!

Sending E-mail

Status
Not open for further replies.

peryan77

Programmer
May 7, 2004
41
0
0
US
I want to create ONE module that I can call from the onclick event of any text box on my form that will send an e-mail to the value in the textbox.

I have 3 text controls that have different e-mail addresses.

I do not want to rewrite the code 3 times.

Is there a function that could do this? Or Do I have to create a public sub?

In either case can someone send me an example?
 
By the way this is what I have...

Function SendE-mail(controlvalue)

Dim otk As Object
Dim eml As Object

Const olMailItem = 0
Set otk = CreateObject("Outlook.Application")
Set eml = otk.CreateItem(olMailItem)
With eml
.To = controlvalue
'.Bcc = .Fields("E-mail_1")
'.Subject = "Test"
'.Body = "Test."
'.Attachments.Add "C:"
'.Send
End With
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top