Jump to content

Kaoru

Members
  • Content Count

    25
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Kaoru

  • Rank
    Newbie
  1. Kaoru

    Email form

    OK, just to refresh things, here's the code I currently have: <%@ Page Language="VB" Debug="true" %><%@ Import Namespace="System.Net.Mail" %><script runat="server"> Sub doEmail(Source as Object, E as System.Web.UI.ImageClickEventArgs) Dim sMsg as String sMsg+="Name :" & txtName.Text & vbcrlf sMsg+="Message :" & txtMessage.Text & vbcrlf Dim objEmail as New MailMessage objEmail.IsBodyHtml = true objEmail.To.Add(new MailAddress("support@astralwd.co.za")) objEmail.From.Add(new MailAddress(txtEmail.Text)) objEmail.Subject=txtSub.Text objEmail.Body=sMsg D
  2. Kaoru

    Email form

    I'm using the 2.0 framework, and I have been using the System.Net.Mail namespace for quite some time now... <%@ Import Namespace="System.Net.Mail" %>
  3. Kaoru

    Email form

    Well, we seem to getting there, only now (to my complete and utter confusion), I'm getting another compilation error: What confuses me about this, is that it didn't have any problems with Add being used objEmail.To ...jesh, you mentioned the following:Dim SmtpMailSet SmtpMail = new SmtpClient("smtp.astralwd.co.za") I'm assuming that's how it's done is C#, but just for interest, here's how it's done in VB: Dim SmtpMail as new SmtpClientSmtpMail.SmtpClient = "smtp.astralwd.co.za" One of the things I've learned so far... having hassled with this for around a week...
  4. Kaoru

    Email form

    Right, now that's done, now I'm getting other errors... this CANNOT be this hard Here's my code yet again for reference:<script runat="server"> Sub doEmail(Source as Object, E as System.Web.UI.ImageClickEventArgs) Dim sMsg as String sMsg+="Name :" & txtName.Text & vbcrlf sMsg+="Message :" & txtMessage.Text & vbcrlf Dim objEmail as New MailMessage objEmail.IsBodyHtml = true objEmail.To.Add(new MailAddress("support@astralwd.co.za")) objEmail.From=txtEmail.Text objEmail.Subject=txtSub.Text objEmail.Body=sMsg objEmail.BodyFormat = MailFormat.Html Dim SmtpMail as
  5. Kaoru

    Email form

    Right... I replaced all the elements with asp controls (asp:TextBox... etc.) and it now finds the elements, but I'm still getting the following errors:
  6. Kaoru

    Email form

    Yes, txtName, txtEmail, txtSub, and txtMessage are all text elements on the page.I just had a thought that it's saying it can't find them because I'm using <input type="text" id="txtName> as opposed to <asp:TextBox id="txtName"></asp:TextBox>...Why am I using <input...> you ask?? When I saw that I can't use any html controls to duplicate <textarea>, I reverted back to <input>If you can show me how to duplicate <textarea>, I'd really appreciate it.
  7. Kaoru

    Email form

    The site is (as far as I know) a root level site. http://astralwd.co.zaBecause I'm having problems, I've the error page from public eyes with a js alert, but if you include contact.aspx after the domain (i.e. http://www.astralwd.co.za/contact.aspx) you'll see the error. I will be contacting the server admin this evening to check the machine.config file on the server, but it looks like there's errors in the code:At the moment, I've been tweaking the code in Visual Web Developer 2005 - here's the code I have at the moment: 1| <%@ Page Language="VB" Debug="true" %> 2| <%@ Import Namespa
  8. Kaoru

    Email form

    That's exactly what I mean, wierd isn't it...
  9. Kaoru

    Email form

    I'm happy to report that this morning when I tried using the form, it worked 100% correctly !!!!!!!!!!!!What I'm posting for now, is a problem that seemed to materialise out of thin air...When I try to view the page that contains the form, I get the following: In the web.config file, I have set <customErrors mode="Off"/> and I still don't get any change... the owner of the server maintains that there's a problem with the code, but that hasn't changed since it was working...
  10. Kaoru

    Email form

    OK, that got more results now...About the smtp server being specified in the code... is it the one on the server that's receiving the email? I'm assuming so, but please confirm..I want to know because when I tried with my the gmail smtp server, I got this:
  11. Kaoru

    Email form

    OK, that's done, but I'm still getting the compilation error: Compiler Error Message: BC30456: 'doEmail' is not a member of 'ASP.myweb_astral_contact_aspx'.Source Error:Line 57: <tr>Line 58: <td width="10%" align="right"> </td>Line 59: <td colspan="2"><asp:ImageButton id="btnSend" runat="server" OnClick="doEmail" ImageUrl="Images/submit.gif" /></td>Line 60: </tr>Line 61: </table> I've checked on microsoft website, all that's on there has something to do with DataGrids... I'm not using DataGrids...
  12. Kaoru

    Email form

    Did I mention I'm new to asp.NET ? How do I adjust my code to make it work?
  13. Kaoru

    Email form

    OK, done that, now I'm getting the following: I had this before, replacing onClick with command is what fixed it... all the forums I go to say to check the behind code or something like that... but I can't remember...
  14. Kaoru

    Email form

    I have the following code at the beginning of my page: <%@ Page Language="VB" %><%@ Import Namespace="System.Web.Mail" %> Sub doEmail(Source as Object, E as EventArgs) Dim sMsg as String sMsg+="Name :" & txtName.Text & vbcrlf sMsg+="Email :" & txtEmail.Text & vbcrlf Dim objEmail as New MailMessage objEmail.To=logan_young@hotmail.com objEmail.From=txtEmail.Text objEmail.Subject=txtSub.Text objEmail.Body=sMsg objEmail.BodyFormat = MailFormat.Text SmtpMail.SmtpServer ="smtp.gmail.com SmtpMail.Send(objEmail) End Sub After that, it's the html... here's the c
×
×
  • Create New...