dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Sending emails

  1. #1
    Sending emails Guest

    Sending emails


    Hi, I have vb.net and am trying to create a program that will automatically
    send an email to a certain email address if I receive "No" as an answer to
    my query. How do I go about doing this? Thanks.

  2. #2
    Michael Cole Guest

    Re: Sending emails

    Sending emails wrote:
    > Hi, I have vb.net and am trying to create a program that will
    > automatically send an email to a certain email address if I receive
    > "No" as an answer to my query. How do I go about doing this? Thanks.


    First step - Ask in a VB.Net newsgroup...



  3. #3
    John Maddox Guest

    Re: Sending emails


    "Michael Cole" <michael.cole@hansen.com> wrote:
    >Sending emails wrote:
    >> Hi, I have vb.net and am trying to create a program that will
    >> automatically send an email to a certain email address if I receive
    >> "No" as an answer to my query. How do I go about doing this? Thanks.

    >
    >First step - Ask in a VB.Net newsgroup...
    >
    >

    While I agree that the question smight be in the wrong newsgroups there should
    not be any difference in the way this might be coded in VB and VB.net.

    Here is an eample of sending email using almost any outlook client. This
    is not my code but was adapted from a similiar newsgroup query
    Private Sub cmdSend_Click()

    Dim objOutlook As Object
    Dim objMailItem As Object
    Dim p_sEmailAddress As String
    Dim p_sCC As String
    Dim p_sSubject As String
    Dim p_sBody As String

    Set objOutlook = CreateObject("Outlook.Application")
    Set objMailItem = objOutlook.CreateItem(&H123)

    p_sEmailAddress = "XXXX@yyyy.zzzz"
    p_sCC = "XXXX1@yyyy.zzzz"
    p_sSubject = "My subject"
    p_sBody = "Body of message goes here"

    With objMailItem
    .To = p_sEmailAddress
    .CC = p_sCC
    .Subject = p_sSubject
    .Body = p_sBody
    .Send
    End With

    Set objMailItem = Nothing
    Set objOutlook = Nothing

    End
    End Sub


    Now as to how to do this I have code that will determine the record or recordset
    that is returned. if your query is written to that it does actually return
    "Yes/No" then just place an if statement their to evaluate the response and
    then run the code above.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center