• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

SMTP Submission via a checkbox

I need a form, that contacts a check box, that when checked, prompts the user "Do you want to send an alert?" and if they say "Yes" sends the email out to a hardcoded email address within the code using SMTP.   Can someone please help me out with this?  
0
chrisryhal
Asked:
chrisryhal
  • 2
  • 2
1 Solution
 
BrianGEFF719Commented:
Take a look at the following control, it will add full SMTP functionality to your program in 5 minutes.

http://www.ostrosoft.com/smtp_component/smtp_vb.asp
0
 
BrianGEFF719Commented:
BTW, that control is free aslong as you dont sell your software, and even if you do it only costs $19
0
 
davidkroiterCommented:
You can just reference your project with Microsoft Outlook then use the following commands:

Private mobjOut As Outlook.Application

Private Sub mychkbox_click()
   Call Send(email@address.com, "FirstNameofRecepient")
End Sub

Sub Send(sEmail As String, sFirstName As String)
    Dim obj As Outlook.MailItem
    Dim HTMLDetail As String
    HTMLDetail="This is what I went the alert to say"
    obj.HTMLBody = HTMLDetail
    obj.To = sEmail
    obj.Subject = "My Emails subject"
    obj.Send
End Sub
0
 
davidkroiterCommented:
You would probably want your checkbox code to be more like this:

Private Sub mychkbox_click()
   If mychkbox.value=true then
      response=msgbox ("Do you want to send an alert?", vbQuestion + vbYesNo, "Send Alert?")
      if response=vbNo then exit sub
      Call Send(email@address.com, "FirstNameofRecepient")
   End if
End Sub

Or something to that effect.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now