contact page-sending from user email?!http://forums.asp.net/t/1288950.aspx/1?contact+page+sending+from+user+email+Tue, 15 Jul 2008 11:30:41 -040012889502484961http://forums.asp.net/p/1288950/2484961.aspx/1?contact+page+sending+from+user+email+contact page-sending from user email?! <p>Hi,</p> <p>May you explain to me how the contact page setting is working?I mean is the email writtin the textbox ignored and how?If so what determine the sender email and the receiver email?</p> 2008-07-12T05:49:37-04:002485626http://forums.asp.net/p/1288950/2485626.aspx/1?Re+contact+page+sending+from+user+email+Re: contact page-sending from user email?! <p>Take a look in the web.config at</p> <pre class="prettyprint">&lt;theBeerHouse defaultConnectionStringName=&quot;LocalSqlServer&quot;&gt; &lt;contactForm mailTo=&quot;thebeerhouse@wrox.com&quot;/&gt; &lt;articles pageSize=&quot;10&quot; /&gt; &lt;polls archiveIsPublic=&quot;true&quot; votingLockByIP=&quot;false&quot; /&gt; &lt;newsletters fromEmail=&quot;thebeerhouse@wrox.com&quot; fromDisplayName=&quot;TheBeerHouse&quot; /&gt; &lt;forums threadsPageSize=&quot;8&quot; hotThreadPosts=&quot;10&quot; bronzePosterPosts=&quot;10&quot; silverPosterPosts=&quot;20&quot; goldPosterPosts=&quot;50&quot; /&gt; &lt;store sandboxMode=&quot;true&quot; businessEmail=&quot;thebeerhouse@wrox.com&quot; /&gt; &lt;/theBeerHouse&gt;</pre> <p>&nbsp;For the default values.</p> <p>Hope it helps</p> 2008-07-12T19:01:39-04:002486017http://forums.asp.net/p/1288950/2486017.aspx/1?Re+contact+page+sending+from+user+email+Re: contact page-sending from user email?! <p>OK.This mean the email <font color="#0000ff"><a href="mailto:thebeerhouse@wrox.com">thebeerhouse@wrox.com</a> is the receiver email so what is the sender email?</font></p> 2008-07-13T08:11:55-04:002486025http://forums.asp.net/p/1288950/2486025.aspx/1?Re+contact+page+sending+from+user+email+Re: contact page-sending from user email?! <p>The from address is from the txtEmail.Text, txtName.Text as per the code</p> <p>&nbsp;<pre class="prettyprint">msg.From = new MailAddress(txtEmail.Text, txtName.Text);</pre> </p> <p>&nbsp;&nbsp;</p> <p>Hope it helps</p> 2008-07-13T08:18:04-04:002486031http://forums.asp.net/p/1288950/2486031.aspx/1?Re+contact+page+sending+from+user+email+Re: contact page-sending from user email?! <p></p> <blockquote><span class="icon-blockquote"></span> <h4>jeremyh</h4> <p>The from address is from the txtEmail.Text, txtName.Text as per the code</p> <pre class="prettyprint">msg.From = new MailAddress(txtEmail.Text, txtName.Text);</pre> <p>&nbsp;&nbsp;</p> <p>Hope it helps</p> <p></p> </blockquote> <p></p> <p>Now that is my question..How could the website send from the user email without knowing his user name and password as you know this is not mailto which will open on the client computer?!</p> 2008-07-13T08:25:24-04:002486034http://forums.asp.net/p/1288950/2486034.aspx/1?Re+contact+page+sending+from+user+email+Re: contact page-sending from user email?! <p>Oh Ok well the setting that it is using to send the mail are these from the web.config</p> <pre class="prettyprint">&lt;system.net&gt; &lt;mailSettings&gt; &lt;!-- &lt;smtp deliveryMethod=&quot;Network&quot;&gt; --&gt; &lt;smtp deliveryMethod=&quot;PickupDirectoryFromIis&quot; from=&quot;thebeerhouse@wrox.com&quot;&gt; &lt;network defaultCredentials=&quot;true&quot; host=&quot;(localhost)&quot; port=&quot;25&quot; /&gt; &lt;/smtp&gt; &lt;/mailSettings&gt; &lt;/system.net&gt;</pre>&nbsp; 2008-07-13T08:28:42-04:002486057http://forums.asp.net/p/1288950/2486057.aspx/1?Re+contact+page+sending+from+user+email+Re: contact page-sending from user email?! <p></p> <blockquote><span class="icon-blockquote"></span> <h4>jeremyh</h4> <p>Oh Ok well the setting that it is using to send the mail are these from the web.config</p> <pre class="prettyprint">&lt;system.net&gt; &lt;mailSettings&gt; &lt;!-- &lt;smtp deliveryMethod=&quot;Network&quot;&gt; --&gt; &lt;smtp deliveryMethod=&quot;PickupDirectoryFromIis&quot; from=&quot;thebeerhouse@wrox.com&quot;&gt; &lt;network defaultCredentials=&quot;true&quot; host=&quot;(localhost)&quot; port=&quot;25&quot; /&gt; &lt;/smtp&gt; &lt;/mailSettings&gt; &lt;/system.net&gt;</pre> <p>&nbsp;</p> </blockquote> <p></p> <p>Don't you think it is impossible to use the same email to send the message and receive it?</p> 2008-07-13T09:04:53-04:002486223http://forums.asp.net/p/1288950/2486223.aspx/1?Re+contact+page+sending+from+user+email+Re: contact page-sending from user email?! <p>Sorry I am not sure I understand you here, but if you have a website and you send out email as <a href="mailto:info@domain">info@domain</a> but you could still have<br> email sent to you on that address.</p> <p>But I guess most of the time you would not send mail to youself, unless you where testing something out.</p> <p>Hope it helps</p> <p>&nbsp;</p> 2008-07-13T13:24:17-04:002489119http://forums.asp.net/p/1288950/2489119.aspx/1?Re+contact+page+sending+from+user+email+Re: contact page-sending from user email?! <p>As you mentioned in your previous posts the email in both settings is:<font color="#0000ff">thebeerhouse@wrox.com as following:</font></p> <p>&nbsp;<pre class="prettyprint">&lt;contactForm mailTo=&quot;thebeerhouse@wrox.com&quot;/&gt;</pre> <P mce_keep="true">&nbsp;</P><pre class="prettyprint">&lt;<SPAN class=tag>smtp</SPAN><SPAN class=attr> deliveryMethod=</SPAN><SPAN class=attrv>"PickupDirectoryFromIis"</SPAN><SPAN class=attr> from=</SPAN><SPAN class=attrv>"thebeerhouse@wrox.com"</SPAN>&gt; </pre> </p> <p>&nbsp;</p> <p>Which means we are setting the same email as in &quot;from&quot; and &quot;mailto&quot;&nbsp;.Is this correct?</p> 2008-07-14T21:24:06-04:002489944http://forums.asp.net/p/1288950/2489944.aspx/1?Re+contact+page+sending+from+user+email+Re: contact page-sending from user email?! <p>Yes, So you need to set these up to your own settings before you deploy the site.</p> 2008-07-15T09:12:21-04:002490201http://forums.asp.net/p/1288950/2490201.aspx/1?Re+contact+page+sending+from+user+email+Re: contact page-sending from user email?! <p></p> <blockquote><span class="icon-blockquote"></span> <h4>jeremyh</h4> <p>Yes, So you need to set these up to your own settings before you deploy the site.</p> </blockquote> &nbsp; <p>Thank you for continue with me all the time i nthis thread.I tested the settings in an online website and it works fine.I used the same email in both settings(mailTo and from) and it works.I don't know how this become possible but it is working fine anyway.The email in the textbox will appear as it is the sender too when you receive the email.This is realy great.If any one know how this become possible please explain to us.</p> <p>&quot;If any member find my post helpfull for him please mark it as answer&quot;.</p> 2008-07-15T11:04:30-04:002490261http://forums.asp.net/p/1288950/2490261.aspx/1?Re+contact+page+sending+from+user+email+Re: contact page-sending from user email?! <p>Glad that you are happy.</p> <p>Let me try another way to answer your question in the contact.aspx.cs you have</p> <p>msg.From = new MailAddress(txtEmail.Text, txtName.Text); </p> <p>Setting the from address to the txtemail textbox vale</p> <p>And then you have <br> msg.To.Add(new MailAddress(Globals.Settings.ContactForm.MailTo));<br> Which is getting the value from the web.config contactForm mailTo=&quot;<a href="mailto:thebeerhouse@wrox.com%22/">thebeerhouse@wrox.com&quot;/</a></p> <p>Then you also have the from address setup in the web.config for the newsletter.</p> <p>And then final you have the smtp settings in the web.config, which is used for things like forgot password<br> and anyother general email setting with a from address.</p> <p>Hope it helps</p> <p>&nbsp;</p> 2008-07-15T11:30:41-04:00