Group29.com - What did you expect?
  Create an account
:: Home  ::  Downloads  ::  Your Account  ::  Forums  ::
Google Adsense
Modules
  • Home
  • Downloads
  • ExpectationReviews
  • Forums
  • Group29 FAQ
  • MovieReviews
  • OtherReviews
  • Stories Archive
  • Submit News
  • Top 10
  • Topics
  • Web Links
  • New at Group29
    ·Movie Review: Star Wars: The Last Jedi [23]
    ·2017 USC vs UCLA preview
    ·Movie Review: IT (2017) [25]
    ·Forum Topic: Update your Facebook property
    ·2016 UCLA vs USC preview
    ·Expectation Review: Star Wars: The Force Awakens [29]
    ·Web Link: WEP Key Converter
    ·Expectation Review: Jupiter Ascending [25]
    ·Forum Topic: Why does my IPA file get saved as a zip file in IE?
    ·Web Link: BeyondCompare

    read more...
    TheForce.Net
    Currently there is a problem with headlines from this site
    Hot trends
    ·Group29.com

    read more...
    Group29 Discussion Board :: View topic - Sending Mail from An ASP.NET page using VB.NET
    Log in Register Forum FAQ Memberlist Search
    Ratings, Links, Free Speech and more

    Group29 Discussion Board Forum Index -> Group29 Tech Tips -> Sending Mail from An ASP.NET page using VB.NET
    Post new topic  Reply to topic View previous topic :: View next topic 
    Sending Mail from An ASP.NET page using VB.NET
    PostPosted: Tue Jan 25, 2005 2:55 pm Reply with quote
    BB
    Regular
     
    Joined: Jun 23, 2004
    Posts: 340


      


    In a previous post, I had some sample code for sending an e-mail from an ASP page with inline code using the CDO objects for Windows 2000 and Windows 2003.

    I created a function, which I actually placed in an application class, to send e-mail from a feedback page.

    Code:
    ' Send your message body here
     Public Sub FeedBackMail()
       
       Dim mSMTP As SmtpMail
       Dim MailCurrent As MailMessage
       MailCurrent = New MailMessage()

       Dim sFileNameOnly As String
       sFileNameOnly = ""
       ' Not currently implemented to attach files


       ' I had Set configuration for mail host in an XML config file
       ' this example is more abbreviated to show the workings
       
       'Assign mail attributes
       'Seperate multiple TO: email adresses with a comma seperator
       MailCurrent.To = "administrator@mydomain.com"
       ' From needs to be a valid email return address
       '  or Lotus Notes Mail will discard the message as SPAM
       MailCurrent.From    = "ap-runner@mydomain.com
       MailCurrent.Subject = "App Feedback from Web Site"
       MailCurrent.Body    = "this is the body of the e-mail"
       ' Need to use text as the mail body format
       ' for Lotus notes client
       MailCurrent.BodyFormat = MailFormat.Text

       ' File to mail? add it to the email
       If Len(sFileNameOnly) > 0 Then
       MailCurrent.Attachments.Add(sFileNameOnly)
       End If

            'Set SMTP server to configured host
            mSMTP.SmtpServer = "smtpserver.mydomain.com"
            ' by the way, this method does not work!
            ' mSMTP.SmtpServer.Insert(0, "smtpserver.mydomain.com")

            'Send mail
            mErrorMessage = ""

            Try
                mSMTP.Send(MailCurrent)
            Catch e As Exception
                ' Notify that no e-mail was sent
                mErrorMessage = "Error Sending e-mail:" & e.Message

            End Try
    End Sub
    View user's profile Visit poster's website
    Sending Mail from An ASP.NET page using VB.NET
      Group29 Discussion Board Forum Index -> Group29 Tech Tips
    You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot vote in polls in this forum
    All times are GMT - 6 Hours  
    Page 1 of 1  

      
      
     Post new topic  Reply to topic  


    Powered by phpBB © 2001-2003 phpBB Group
    Theme created by Vjacheslav Trushkin
    Forums ©
    Group29 Productions

    All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest (c) 2006 by Group29 Productions.


    You can syndicate Group29 Productions news with an RSS Feeder using the file backend.php


    PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
    Page Generation: 0.10 Seconds

    :: HeliusGray phpbb2 style by CyberAlien :: PHP-Nuke theme by www.nukemods.com ::