Jump to content

Kaoru

Members
  • Content Count

    25
  • Joined

  • Last visited

Everything posted by Kaoru

  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
  15. Below is the ASP code that I found to do (hopefully) what I want done: <%Set myMail=CreateObject("CDO.Message")myMail.Subject="Sending email with CDO"myMail.From="mymail@mydomain.com"myMail.To="someone@somedomain.com"myMail.HTMLBody = "<h1>This is a message.</h1>" myMail.Sendset myMail=nothing%> Does this differ at all from the asp.NET code that does the same thing? I've been looking, but I can't find asp.NET code...
  16. I have the code for an email form, but I'm at a loss regarding where on the page to put it.I got the code from w3schools, but, I don't know whether or not to put it above the DOCTYPE and <html> declarations, or in the html code where I want the form to appear on the page.I'm an ASP newbie (only just started learning about a month ago) so I'm still not sure how things work.Any help would be appreciated.
  17. Kaoru

    Email form

    I've made myself an email form: <form action="mailto: me@this.domain.com?subject=Whats a subject?" method="post"> Above is just an example of what I've done...but when I try to test it, it opens a blank email instead of sending the email. could this be because I haven't uploaded the page yet?
  18. Ah, well, the expandable block almost works 100%...My only problem now, is that in most of the applications I've set for it, the text saying "Show Expandable Block" doesn't display on the page when it loads.<a href="http://astralwd.bravehost.com/expand.html">Here's an example for reference</a>
  19. Ok, I managed to fix the problem!Seems that since I'm still relatively new to JS, I wrote the function above to make the block expand. I left out another function that's needed, once I included that, it all works 100%.
  20. I don't have webspace for the site yet, unfortunately. I'm still developing the site and I'm waiting for payment so that I can get webspace.Any ideas so far?A friend said to change the hyperlink to<a href="java script: expandCollapse('tabInfoBlockID', true);setTabInfo('tabInfoBlockID'); return false;"> but that doesn't do anything (the block doesn't even expand)Then he said: I'm not sure what he meant by that, so I haven't done anything (just reset it to the way I had it originally)
  21. The error comes up when I click the link. Here's the java script:function expandCollapse(elem, changeImage){ if (document.getElementById) { ecBlock = document.getElementById(elem); if (ecBlock != undefined && ecBlock != null) { if (changeImage) { elemImage = document.getElementById(elem + "Image"); } if (elemImage != undefined && elemImage != null) { if (ecBlock.currentStyle.display == "none" || ecBlock.currentStyle.display == null || ecBlock.currentStyle.display == "") { ecBlock.style.display = "block"; if (changeImage) { elemImage.src =
  22. This one confuses me quite a bit...I've coded an expandable block on my page, and it works fine, but my browser keeps giving me an "object expected" error on the hyperlink. <a href="#" onclick="expandCollapse([color="#FF0000"]_[/color]'tabInfoBlockID', true); setTabInfo('tabInfoBlockID'); return false;"> I've put a red underscore where the browser tells me the error is.Apparently it's not a fatal error, seeing as the block expands, but since this site is for my business, I'd like to look as professional as possible and having errors popping up doesn't look professional
  23. I wanted to password protect a few of my pages too, and although everyone told me it's better to do it with php, I did it with javascript. It's secure enough for me considering the info behind the password protection script isn't sensitive stuff:Here's the javascript code: function protect(form) { if (document.passform.password.value == "password here") { alert("Password correct, forwarding..."); document.location.href="members.html"; } else { alert("Password Incorrect"); } The document.passform.password.value would be the <input type="text"> field on the form (in this case the form
  24. Thanks Lulzim, never wouldda thought of that... I'm still pretty n00b really, working on getting better tho
  25. I've just finished working on my "members only" section - I know, JavaScript isn't the best thing to use for security, but it's all I know how to use.I'm using a cookie to store the username supplied when the password is entered correctly, when the user views the main page on the secured section of the site, it brings up an alert with a welcome message.Instead of using an alert, I want the function to write a welcome message on the page itself without replacing any text already on that page: Above show how I want it to look, below shows the function that checks for the cookie's existance and
×
×
  • Create New...