Help with setting up Email link

Discussion in 'ASP.NET 2.0' started by bigmike40, Apr 19, 2007.

  1. Could someone help with setting up a email link on my site .
    i need to know howto setup a text box and a button id
    Thanks
     
  2. Can you tell us which IDE you're using (i.e. Visual Studio 2005)and exactly how you want the Input control to function?

    Then we'll post exactly what you need. [​IMG]
     
  3. I'm using VWD05 ON SQL 2000 .I'd like to have a email linkthatusers can sendfeedback or a cantac page etc, on the website
    Thanks wisemx
     
  4. Idid watch the video. If i wanted to run it onthe server will the code work or do i haveto modify them .
    Ihave watch some of these videos and it seems that some these example would work for SQLEXPRESS orin a local environment.I have tryed to incorporate some of these in remote environment but all i get is errors.
    So how would do i setup a simple button email link
    Thanks
     
  5. I try using the code below and get this error




    Protected Sub PasswordRecovery1_SendingMail(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.MailMessageEventArgs) Handles PasswordRecovery1.SendingMail



    '!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS



    Const ToAddress As String = "your email address"



    '(1) Create the MailMessage instance



    Dim mm As New System.Net.Mail.MailMessage("from address", ToAddress)



    '(2) Assign the MailMessage's properties


    mm.Subject = e.Message.Subject


    mm.Body = e.Message.Body



    '(3) Create the SmtpClient object



    Dim smtp As New System.Net.Mail.SmtpClient



    '(4) Send the MailMessage (will use the Web.config settings)



    Try


    smtp.EnableSsl =
    True


    smtp.Send(mm)



    Catch ex As Exception


    MsgBox(ex.Message)



    End Try



    'don't send the System.Net.Mail.MailMessage


    e.Cancel =
    True



    End Sub


    Server Error in '/' Application.


    Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

    Source Error:





    Code:
    Line 34: 
    Line 35:         Catch ex As Exception
    Line 36:             MsgBox(ex.Message)
    Line 37: 
    Line 38: 
     
  6. Bruce

    Bruce DiscountASP.NET Staff

    MsgBox(ex.Message) is the cause.


    MsgBox is for WinForm application and you should NOT use it for any asp.net application.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  7. After moving the that code i didnt get the error but the mail didnt send. and once i change the code eCancel to false i got the authentication error
     
  8. I got itworking . thanks
     

Share This Page