VS 2010 ASP.NET VB Email form V2-VBForums
Results 1 to 18 of 18

Thread: ASP.NET VB Email form V2

  1. #1

    Thread Starter
    Junior Member Daora-D's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    16

    ASP.NET VB Email form V2

    Hello it's me again, i'm gonna need some help processing the email form so the user can send email to my email address. heres the form im working on.

    http://daora-d.com/Contact%20Form/

    The button ID i need to configure is the btnEmail. I searched all over teh internet and so far i havnt found a code that work coz i need a working email form for my website.

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    4,228

    Re: ASP.NET VB Email form V2

    What code are you currently use to send the email?
    Slow as hell.

  3. #3

    Thread Starter
    Junior Member Daora-D's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    16

    Re: ASP.NET VB Email form V2

    Quote Originally Posted by sapator View Post
    What code are you currently use to send the email?
    None yet but i configured the web.config file to communicate with my mail server. Have you viewed the source code on my web page?

  4. #4
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    4,228

    Re: ASP.NET VB Email form V2

    Is there anything that will help us if we view your source code?
    You said that you haven't done any coding.
    Better Google around a little on how to send mail and then if you have problems sending your mail post your questions.
    Ah, also post your web.config section that you fixed for your mail....An while on it post also your login credentials your credit card number and you password on every site you are currently member(i hope you don't do it) ....
    Slow as hell.

  5. #5

    Thread Starter
    Junior Member Daora-D's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    16

    Re: ASP.NET VB Email form V2

    I've uploaded my email project so if you guys found a solution you may add code but please can you comment the areas on where you have written the code you have provided me?

    As mentioned before i need to configure the Email Daora D button.
    Attached Files Attached Files

  6. #6
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    4,228

    Re: ASP.NET VB Email form V2

    Yes , well i don't think anyone will give you the code, at least on this forum.You have to tell us what you are trying and what code you use.
    I also asked for your web config(along with the other) section that you configure your email to see if you have done it right.Let's start from that but personally am going to bed so if no one has answered i'll take a look tomorrow.
    Slow as hell.

  7. #7

    Thread Starter
    Junior Member Daora-D's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    16

    Re: ASP.NET VB Email form V2

    Quote Originally Posted by sapator View Post
    Yes , well i don't think anyone will give you the code, at least on this forum.You have to tell us what you are trying and what code you use.
    I also asked for your web config(along with the other) section that you configure your email to see if you have done it right.Let's start from that but personally am going to bed so if no one has answered i'll take a look tomorrow.

    have you checked out my web.config file in the app i uploaded?

  8. #8
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    4,228

    Re: ASP.NET VB Email form V2

    Yes, i would advise not to put your username and password in web.config.You can create a class that will send mails and put your credentials there for safer access or encrypt the web.config but i haven;t tried on the mail namespace.
    Now as i've said you have to create a class to send your emails.What have you found and tried googling around and do you have any problems?
    P.S. for future reference post your code in the forum.It's tiresome to go back and forth looking at your zip.
    Last edited by sapator; May 11th, 2012 at 11:33 PM.
    Slow as hell.

  9. #9

    Thread Starter
    Junior Member Daora-D's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    16

    Re: ASP.NET VB Email form V2

    Quote Originally Posted by sapator View Post
    Yes, i would advise not to put your username and password in web.config.You can create a class that will send mails and put your credentials there for safer access or encrypt the web.config but i haven;t tried on the mail namespace.
    Now as i've said you have to create a class to send your emails.What have you found and tried googling around and do you have any problems?
    P.S. for future reference post your code in the forum.It's tiresome to go back and forth looking at your zip.
    Cheers for the advise.......umm in the web config file is it best to comment the details? I appoligise if i did it wrong after i am new here

  10. #10

    Thread Starter
    Junior Member Daora-D's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    16

    Re: ASP.NET VB Email form V2

    Hi everyone i tried this code but i keep getting blue underlines on the Dim mm as New MailMessage and Dim smtp as New smtpclient

    Code:
     Protected Sub btnEmail_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnEmail.Click
            '!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
            Const ToAddress As String = "ramiabbas@daora-d.com"
    
            '(1) Create the MailMessage instance
            Dim mm As New MailMessage(UsersEmail.Text, ToAddress)
    
            '(2) Assign the MailMessage's properties
            mm.Subject = txtSubject.Text
            mm.Message = txtName.Text
            mm.IsMessageHtml = False
    
            '(3) Create the SmtpClient object
            Dim smtp As New Smtp
    
            '(4) Send the MailMessage (will use the Web.config settings)
            smtp.Send(mm)
    
    
        End Sub
    thats the code i tried for my email button but when i run it Visual Studio says i have errors.

  11. #11
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    4,228

    Re: ASP.NET VB Email form V2

    Hi.For once you are probably missing a namespace
    "Imports System.Net.Mail"

    Now,what do the errors say?
    Slow as hell.

  12. #12

    Thread Starter
    Junior Member Daora-D's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    16

    Re: ASP.NET VB Email form V2

    Quote Originally Posted by sapator View Post
    Hi.For once you are probably missing a namespace
    "Imports System.Net.Mail"

    Now,what do the errors say?
    where does that go in?

  13. #13
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    4,228

    Re: ASP.NET VB Email form V2

    top of page.
    Slow as hell.

  14. #14

    Thread Starter
    Junior Member Daora-D's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    16

    Re: ASP.NET VB Email form V2

    Quote Originally Posted by sapator View Post
    top of page.
    I inserted it on top but i'm still getting blue under-lines.

    is this right?
    Code:
    Imports System.Net.Mail
    Partial Class _Default
        Inherits System.Web.UI.Page
    
        Protected Sub btnClear_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClear.Click
            Server.Transfer("Default.aspx")
        End Sub
    
        Protected Sub btnEmail_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnEmail.Click
            '!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
            Const ToAddress As String = "ramiabbas@daora-d.com"
    
            '(1) Create the MailMessage instance
            Dim mm As New MailMessage  (Underline Useremail)--->(UsersEmail.Text, ToAddress)
    
            '(2) Assign the MailMessage's properties
            mm.Subject = txtSubject.Text
          (Underline)--->   mm.Message = txtName.Text
          (Underline)--->  mm.IsMessageHtml = False
    
            '(3) Create the SmtpClient object
            Dim SMTP As New SmtpClient
    
            '(4) Send the MailMessage (will use the Web.config settings)
            SMTP.Send(mm)
    
    
        End Sub
    
    
    
    
    End Class
    I've pointed out the errors im getting
    Last edited by Daora-D; May 12th, 2012 at 09:10 PM.

  15. #15
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    4,228

    Re: ASP.NET VB Email form V2

    Hi.It appears that we have a serious problem here if you don't know how to use import.What you have shown here is that you just copy pasted the code and expect us to fix it for you.As i've said you have to study and test first.I also suggest some basic vb.net lessons from an eBook because it appears that you cannot even grasp the basics.
    Please first take your time and read the vb.net coding basics and then deal with this page.
    I'm talking like JMC here but i'm afraid that even if i fix your code then you will stuck on the very next piece of coding.I prefer not to do that in order to push you to learn rather than copy-paste.I will be happy to answer any questions that shows effort and basic understanding of the language you use.
    Cheers.
    P.S. You can put your mouse on the blue lines and see what is the error problem.
    Slow as hell.

  16. #16

    Thread Starter
    Junior Member Daora-D's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    16

    Re: ASP.NET VB Email form V2

    Quote Originally Posted by sapator View Post
    Hi.It appears that we have a serious problem here if you don't know how to use import.What you have shown here is that you just copy pasted the code and expect us to fix it for you.As i've said you have to study and test first.I also suggest some basic vb.net lessons from an eBook because it appears that you cannot even grasp the basics.
    Please first take your time and read the vb.net coding basics and then deal with this page.
    I'm talking like JMC here but i'm afraid that even if i fix your code then you will stuck on the very next piece of coding.I prefer not to do that in order to push you to learn rather than copy-paste.I will be happy to answer any questions that shows effort and basic understanding of the language you use.
    Cheers.
    P.S. You can put your mouse on the blue lines and see what is the error problem.
    I only just started learning ASP.NET in my college, diploma is the next level....but at the same time i'm trying to teach myself how to code my designs.

  17. #17
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    4,228

    Re: ASP.NET VB Email form V2

    What i've said is that your problem is vb.net , the .net language not asp.net particularly.Design is another thing, you don't need .net for design.
    Slow as hell.

  18. #18

    Thread Starter
    Junior Member Daora-D's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    16

    Re: ASP.NET VB Email form V2

    Quote Originally Posted by sapator View Post
    What i've said is that your problem is vb.net , the .net language not asp.net particularly.Design is another thing, you don't need .net for design.
    hmm this is going to take a while for this to sink in hehe

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.