By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,203 Members | 1,549 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,203 IT Pros & Developers. It's quick & easy.

error on contact form

P: 1
hello , i am getting this error message "At least one of the From or Sender fields is required, and neither was found."

i have added a contact form all the details are correct as far as i no please can someone check over them and help me fix this this is the web address to the page where the error is

http://www.onlinegamesleague.co.uk/j...o/contact.aspx

this is my source code

Expand|Select|Wrap|Line Numbers
  1. <%@ Page Title="Jake Hathaway's Portfolio l Contact Me"  MasterPageFile="MasterPage.master"
  2.     AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default"  %>
  3.      <% @Import Namespace="System.Web.Mail" %>
  4.  
  5. <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
  6.     <link rel="stylesheet" href="css/global.css">
  7.         <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
  8.  
  9. <script language="vb" runat="server">
  10.     Sub btnSendFeedback_Click(ByVal sender As Object, ByVal e As EventArgs)
  11.  
  12.         'Create an instance of the MailMessage class
  13.         Dim objMM As New MailMessage()
  14.  
  15.         'Set the properties - send the email to the person who filled out the
  16.         'feedback form.
  17.         objMM.To = "hathawayjake5@googlemail.com"
  18.         objMM.From = txtEmail.Text
  19.  
  20.         'If you want to CC this email to someone else, uncomment the line below
  21.         'objMM.Cc = "someone@someaddress.com"
  22.  
  23.         'If you want to BCC this email to someone else, uncomment the line below
  24.         'objMM.Bcc = "someone@someaddress.com"
  25.  
  26.         'Send the email in text format
  27.         objMM.BodyFormat = MailFormat.Text
  28.         '(to send HTML format, change MailFormat.Text to MailFormat.Html)
  29.  
  30.         'Set the priority - options are High, Low, and Normal
  31.         objMM.Priority = MailPriority.Normal
  32.  
  33.         'Set the subject
  34.         objMM.Subject = "4GuysFromRolla.com - Feedback"
  35.  
  36.         'Set the body
  37.         objMM.Body = "At " + DateTime.Now + " feedback was sent from an ASP.NET " & _
  38.                      "Web page.  Below you will find the feedback message " & _
  39.                      "send by " & txtName.Text & "." & vbCrLf & vbCrLf & _
  40.                      "---------------------------------------" & vbCrLf & vbCrLf & _
  41.                      txtMessage.Text & vbCrLf
  42.  
  43.  
  44.         'Specify to use the default Smtp Server
  45.         SmtpMail.SmtpServer = "smtp.gmail.com"
  46.  
  47.         'Now, to send the message, use the Send method of the SmtpMail class
  48.         SmtpMail.Send(objMM)
  49.  
  50.  
  51.         panelSendEmail.Visible = False
  52.         panelMailSent.Visible = True
  53.     End Sub
  54.  
  55.  
  56. </script>
  57.  
  58. </asp:Content>
  59.  
  60. <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
  61. <div class="contactback"><div class="contactdetailstext"><span style="font-family:Verdana;">Contact Details:</span></div><div class="contactdetailstext2"><span style=" font-weight:bold;">Address:</span><br />44 st mellion crescent<br />wrexham<br />ll13 9gz<br /><br /><span style="font-weight:bold;">Mobile:</span> 07824322300<br /><br /><span style="font-weight:bold;">Email Address:</span><br /><a href="mailto:hathawayjake5@googlemail.com?subject=website"> hathawayjake5@googlemail.com</a><br /><br /><span style="font-weight:bold;"><a href="">Facebook</a><br /><a href="">Twitter</a></span></div></div>
  62. <asp:panel id="panelSendEmail" runat="server">
  63.     <form id="Form1" runat="server">
  64.       <h2>We are interested in your feedback!  Please enter the following
  65.       requested information below to send us your comments.</h2>
  66.  
  67.       <b>Your Name:</b>
  68.       <asp:textbox id="txtName" runat="server" />
  69.       <br>
  70.  
  71.       <b>Your Email Address:</b>
  72.       <asp:textbox id="txtEmail" runat="server" />
  73.       <p>
  74.  
  75.       <b>Your Message:</b><br>
  76.       <asp:textbox id="txtMessage" TextMode="MultiLine"
  77.                       Columns="40" Rows="10" runat="server" />
  78.       <p>
  79.  
  80.       <asp:button runat="server" id="btnSendFeedback" Text="Send Feedback!"
  81.                   OnClick="btnSendFeedback_Click" />
  82.     </form>
  83.   </asp:panel>
  84.  
  85.  
  86.   <asp:panel id="panelMailSent" Visible="False" runat="server">
  87.     An email has been sent to the email address you specified.  Thanks!
  88.   </asp:panel>
  89. </asp:Content>
please help me to solve this problem as soon as possible

thanks in advance :)
Mar 19 '11 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.