A
Alex
On a page I have an e-mail (e-mail address removed) with hyperlink. But, I'd like to
give the user the opportunity to do the same thru a form.
I've created a userform with text boxes where the user can enter his/her
name, subject, and message then click button and send this message to the web
site (to (e-mail address removed) ).
How could I implement it thru VB?
I'm thinking about approx. the following code. But, in this code should I
know what e-mail program the user has on his computer or it will be the
server (website hosting) e-mail program and I shouldn't care about the user
e-mail program?
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
'Outlook wasn't running, start it from code
Set OutApp = CreateObject("Outlook.Application")
bStarted = True
End If
Set OutMail = OutApp.CreateItem(0)
.....
On Error Resume Next
With OutMail
.To = …
.CC = …
.Subject = …
.Body = …
.Send
End With
.....
Or I can use something else?
Thanks
give the user the opportunity to do the same thru a form.
I've created a userform with text boxes where the user can enter his/her
name, subject, and message then click button and send this message to the web
site (to (e-mail address removed) ).
How could I implement it thru VB?
I'm thinking about approx. the following code. But, in this code should I
know what e-mail program the user has on his computer or it will be the
server (website hosting) e-mail program and I shouldn't care about the user
e-mail program?
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
'Outlook wasn't running, start it from code
Set OutApp = CreateObject("Outlook.Application")
bStarted = True
End If
Set OutMail = OutApp.CreateItem(0)
.....
On Error Resume Next
With OutMail
.To = …
.CC = …
.Subject = …
.Body = …
.Send
End With
.....
Or I can use something else?
Thanks