Mortgage Loans | Ringtones | Credit Cards | Per Insurance | Mortgages
ActiveX Control Questions [Archive] - PCMech Forums

PDA

View Full Version : ActiveX Control Questions


TheJackal
09-20-2003, 11:40 PM
Im working on an ActiveX control in Visual Basic for use in a web page and I have some questions...

1. The control is, or is going to be an order form. I want for when the user hits the submit button, the data that is contained in the fields of the form to be e-mailed to a certain address, How do I do this?

2. How do I make an Active X control display on my webpage. When I run it through the debugger in Visual Basic it automatically opens in my Internet Explorer, so can I just link to it like another web page, or does it require a bit more work?

panzerfaust
09-23-2003, 06:50 PM
well if you sign the control then you can use a MAPI control like so:

Public Function send_mail(sendto As String, subject As String, _
text As String) As Boolean
'Add The MAPI Components and
'add a MAPI Session and MAPI mail control to your form

On Error GoTo ErrHandler
With MAPISession1
.DownLoadMail = False
.LogonUI = True
.SignOn
.NewSession = True
MAPIMessages1.SessionID = .SessionID
End With
With MAPIMessages1
.Compose
.RecipAddress = sendto
.AddressResolveUI = True
.ResolveName
.MsgSubject = subject
.MsgNoteText = text
.Send False
End With
sendmail = True
ErrHandler:
End Function

Why not just have the server do the sending though it's much easier?

The control needs to be registered and embedded into a page. Download the ActiveX Control Pad and then copy and paste the appropriate tags into your HTML page.