Jump to content

send email button


Recommended Posts

You would have to use PHP for this. Something about the mail() function. Personally, I have 0 experience with PHP, so i can not help you. Someone will post soon. :)

Link to post
Share on other sites

I am useing SQL for this but my total experiance are not that good :)i have some errors still before its finished. I have just used SQL for 4 weeks and i know just alitte done the tutorial's here on W3Schools :)i mostly google around ^^

Link to post
Share on other sites
I am useing SQL for this but my total experiance are not that good :)i have some errors still before its finished. I have just used SQL for 4 weeks and i know just alitte done the tutorial's here on W3Schools :)i mostly google around ^^

ive never heard of SQL i've tried using google to try and get some code for the form but not had much luck with it
Link to post
Share on other sites

this is how my form looks like if you want to see it

<form action="mail.cfm" method="post"><table width="560" height="300">  <tr>    <td height="295"><center><strong>E-mail us here</strong></center>   <table width="242">  <tr>  	<td><div align="right">E-post:   	<input name="Signatur" type="text" dir="ltr" lang="sv" size="18px" maxlength="80px" VALUE="[Needs for answer]"></p></div></td>  </tr>  <tr>  	<td><div align="right">Subjekt:   	<input name="subject" type="text" dir="ltr" lang="sv" size="18px" maxlength="80px"></p></div></td>  </tr>   </table>   <table  align="center" >    <tr>      <td width="333" height="188"> <div align="center">Meddelande<br>  	<Textarea name="Text" rows="10" COLS="40" align="TOP">[Wright your text here]</textarea>      </p>      </div></td>    </tr>   </table>  </td>  </tr></table>  <div align="center">    <input type="submit" name="Submit" value="Skicka">    <input type="reset" name="Reset" value="Återställ">  </div></form>

around the form i have SQL query's but you have never tryed it so but you can use my form for testing. i took away some fetures here and i hope it wont give away any errors if you try it

Link to post
Share on other sites

MS SQL you dont need to link it to a BD this is linked to a sepperated .cfm file who then links to the e-mail adress who is writhen inside that .cfm file. the code below sends the form to the sepperated .cfm fileform action="mail.cfm"and in the mail.cfm this is all that stands in it

<cfmail to="[E-mailadress]" from="#Form.Signatur#" subject="#form.subject#">	EN kund har skickat ett medelande	#Text#</cfmail><cflocation url="Sida.cfm?sida=7&skickat=1" addtoken="yes">

atm i have some codes thats needs to be fixed and iam waiting for my friend who have done the same thing to solve my problems in the code cause iam kinda new on this. I will post the code when the error is gone :)

Link to post
Share on other sites

You can't use SQL for emailing. SQL is talking to databases, so it would work if you were creating a PM system on your site. From what I know, you can't just go fool around with Gmail's sql server. :)

Link to post
Share on other sites

wait and see :)well you can say its somewhat an pm service its just 1 person who gets the E-mail :Dand it wont be stored in databas I have tested alittle whit the errors it sends a e-mail but with no content inside it and the notification dont work. and none of it is stored inside the DB..post 2i have now fixed the code hehe forgot two ## in it so the error dissaper :)here is the code kinda offtopic but related

<cfquery NAME="GetSida" DATASOURCE="Company">SELECT ID, Rubrik, Text FROM dbo.tblSidor WHERE ID = #URL.sida#</cfquery><html><head><title>Sida</title><link href="codes.css" rel="stylesheet" type="text/css"></head><body> <cfoutput query="GetSida">#Rubrik##Text#</cfoutput><cfif getsida.ID is 7 ><cfif isdefined("skickat")><p style="margin-top:30px;text-align:center;font-weight: bold;font-size: 18px;">Message have been sent</p><p style="margin-top:30px;"></p></cfif><form action="mail.cfm" method="post"><table width="560" height="300">  <tr>    <td height="295"><center><strong>E-mail us here</strong></center>	  <table width="242"  align="center" class="mail">		<tr>			<td><div align="right">E-Mail: 			<input name="Signatur" type="text" dir="ltr" lang="sv" size="18px" maxlength="80px"></div></td>		</tr>		<tr>			<td><div align="right>Subjekt: 			<input name="subject" type="text" dir="ltr" lang="sv" size="18px" maxlength="80px"></div></td>		</tr>	  </table>	  <table  align="center" >  		<tr>    		<td width="333" height="188"> <div align="center>Message<br>			<Textarea name="Text" rows="10" COLS="40" align="TOP"></textarea>    		</div></td>  		</tr>	  </table>	 </td>  </tr></table>  <div align="center">    <input type="submit" name="Submit" value="Send">    <input type="reset" name="Reset" value="Clear">  </div></form></cfif></div></body></html>

this page is called sida.cfm and i use ID to input diffrent information from the meny. there might be some </> tagg's left just did a fast fix so all the styles and othes are gone to make the code more purethe mail.cfm you allready know :( its in my previus post, and to take away another error i made i took away all the [needs for anwser/input text]

Link to post
Share on other sites
MS SQL you dont need to link it to a BD this is linked to a sepperated .cfm file who then links to the e-mail adress who is writhen inside that .cfm file. the code below sends the form to the sepperated .cfm fileform action="mail.cfm"and in the mail.cfm this is all that stands in it
<cfmail to="[E-mailadress]" from="#Form.Signatur#" subject="#form.subject#">	EN kund har skickat ett medelande	#Text#</cfmail><cflocation url="Sida.cfm?sida=7&skickat=1" addtoken="yes">

atm i have some codes thats needs to be fixed and iam waiting for my friend who have done the same thing to solve my problems in the code cause iam kinda new on this. I will post the code when the error is gone :)

What you described here is Cold Fusion (.cfm) NOT sql. You made no reference to MS SQL Server in the code you provided. You are NOT using SQL to send mail, you are using the built in mail component of Cold Fusion.
Link to post
Share on other sites

HiTry this VB.Net code..

Dim objMM As New MailMessage            objMM.From = sender@crap.com            objMM.To = reciever@crap.com            objMM.Subject = "This is a test mail"            objMM.BodyFormat = MailFormat.Html            objMM.Body = "Write somthing in the body of the Mail"            SmtpMail.SmtpServer = SMTP Server Name            SmtpMail.Send(objMM)

HTH

Link to post
Share on other sites

So are there two problems here?I see charming4eva is inquiring about how to create a form that will email without using outlook. The answers given (and the assumption) is correct - you will need asp, php, or cold fusion. Each of these applications sends mail through the web server engine (which is set up to send through the a particular mail server). However, since I think version 6.x MS SQL Server has been able to send e-mail directly (i.e. through a stored procedure). But that was only possible if the server was set up with MS Exchange Server - but this might have changed with MS SQL Server 2005.In any respect, I would think it is safe to assume that anyone developing ins asp, php, or cold fusion is using the respective server engine to send the email via the SMTP server configured and not through the SQL server.Anymore clarification needed here?Them Mimika offers some cold fusion code (btw - nice to see another cold fusion user) in an attempt to show how a scripting language would work for this scenario. But this seems to be going in another direction. Mimika, if you need help with you Cold Fusion issue, could you please post it in another topic so we don't hi-jack this one.Thanks

Link to post
Share on other sites

np :)my mening was not to hi-jack sorryI have only been working with MS SQL-Coldfusion and css for about 5-6 weeks exept MS SQL just 4 weeks. sorry if i persumed i did the mail servies in SQL thought that cause of all querys at the main page and the ## :( i will try to better myself :)

Link to post
Share on other sites
np :)my mening was not to hi-jack sorryI have only been working with MS SQL-Coldfusion and css for about 5-6 weeks exept MS SQL just 4 weeks. sorry if i persumed i did the mail servies in SQL thought that cause of all querys at the main page and the ## :( i will try to better myself :)

No worries. I'm just trying to make sure the initial issue has a resolution before it gets forgotten. Which, btw, it seems that it has been resolved in some fashion since charming4eva hasn't been back here to reply to any other posts.Having said that, can you clarify a little more about what you mean here:
sorry if i persumed i did the mail servies in SQL thought that cause of all querys at the main page and the ##
Do you still have an issue that you'd like some help on?
Link to post
Share on other sites

nah i have fixed the main issues with the codes. atm i dont have any questions but i will later but now iam just doing some alterations so i get a cleaner design.when i need help i post it in the correct topic :)

Link to post
Share on other sites
nah i have fixed the main issues with the codes. atm i dont have any questions but i will later but now iam just doing some alterations so i get a cleaner design.when i need help i post it in the correct topic :)

Sounds good. I'm try to get the admins to add another Category for Cold Fusion. I know its not one they offer tutorials on (yet), but it would be nice to cater to all the major scripting languages.
Link to post
Share on other sites
So are there two problems here?I see charming4eva is inquiring about how to create a form that will email without using outlook.  The answers given (and the assumption) is correct - you will need asp, php, or cold fusion.  Each of these applications sends mail through the web server engine (which is set up to send through the a particular mail server).  However, since I think version 6.x MS SQL Server has been able to send e-mail directly (i.e. through a stored procedure).  But that was only possible if the server was set up with MS Exchange Server - but this might have changed with MS SQL Server 2005.In any respect, I would think it is safe to assume that anyone developing ins asp, php, or cold fusion is using the respective server engine to send the email via the SMTP server configured and not through the SQL server.Anymore clarification needed here?Them Mimika offers some cold fusion code (btw - nice to see another cold fusion user) in an attempt to show how a scripting language would work for this scenario. But this seems to be going in another direction.  Mimika, if you need help with you Cold Fusion issue, could you please post it in another topic so we don't hi-jack this one.Thanks

I am in the same boat as charming4eva. I don't know what you are talking about at all. So do I have to create the page that has this email form in PHP or ASP? How do I do this in Dreamweaver? Sorry, I am really new at all this stuff and I am trying to build a website for my coming wedding. I had a little HTML in college so my background is very minor. So far, I have been reading as many sites on the web as I can and am looking at source code of pages I like to see what has been used. However, I don't understand a lot of it and some of the more advanced features, like encorporating Flash or all this ASP, PHP, etc., stuff.
Link to post
Share on other sites
I am in the same boat as charming4eva.  I don't know what you are talking about at all.  So do I have to create the page that has this email form in PHP or ASP?  How do I do this in Dreamweaver?  Sorry, I am really new at all this stuff and I am trying to build a website for my coming wedding.  I had a little HTML in college so my background is very minor.  So far, I have been reading as many sites on the web as I can and am looking at source code of pages I like to see what has been used.  However, I don't understand a lot of it and some of the more advanced features, like encorporating Flash or all this ASP, PHP, etc., stuff.

Welcome to the forums. The process that has been described goes like this:a.) code a page that has a form on it that collects the information you want. This is done with HTML - call it contactme-form.htmb.) code a page that will process the information that is submitted by the form - call this page contactme-action.cfm. To work "action" attribute in contactme-form.htm is set to equal contactme-action.cfm.c.) the form processing page (the action page) is processed on the server. So a server side language must be used. Since my example uses ".cfm" I am implying the use of Cold Fusion. If you choose so, you can just as easily change that to ".php" or ".asp" depending on your preference or what server you have.d.) when contactme-action.cfm is done taking the form information in and sending the e-mail, then it woudl be coded to then redirect to a confirmation page - call it contactme-thanks.htm.Does this outline it a little better?All in all - you will need a server side scripting language to do this unless you find a free internet email gateway.
Link to post
Share on other sites
Welcome to the forums.  The process that has been described goes like this:a.) code a page that has a form on it that collects the information you want.  This is done with HTML - call it contactme-form.htmb.) code a page that will process the information that is submitted by the form - call this page contactme-action.cfm.  To work "action" attribute in contactme-form.htm is set to equal contactme-action.cfm.c.) the form processing page (the action page) is processed on the server.  So a server side language must be used.  Since my example uses ".cfm" I am implying the use of Cold Fusion.  If you choose so, you can just as easily change that to ".php" or ".asp" depending on your preference or what server you have.d.) when contactme-action.cfm is done taking the form information in and sending the e-mail, then it woudl be coded to then redirect to a confirmation page - call it contactme-thanks.htm.Does this outline it a little better?All in all - you will need a server side scripting language to do this unless you find a free internet email gateway.

That helps a little, I guess. Thanks for the help. However, how would I code the page that will process the information that is submitted by the form? Would the contactme-thanks.htm be another coded page? I use Webhost4life as my hosting server, so they support ".php" and ".asp" and coldfusion as well, I think. What are the differences between the two. Are some better used for certain uses, i.e. message boards, photo viewers, etc.? I have no idea. Thanks for all your help.
Link to post
Share on other sites
That helps a little, I guess.  Thanks for the help.  However, how would I code the page that will process the information that is submitted by the form?  Would the contactme-thanks.htm be another coded page?  I use Webhost4life as my hosting server, so they support ".php" and ".asp" and coldfusion as well, I think.  What are the differences between the two.  Are some better used for certain uses, i.e. message boards, photo viewers, etc.?  I have no idea.  Thanks for all your help.

Thats what I describe, a page for teh form, a page to process the form, and a third to say thanks. Now, many people prefer to make the first page conditional - so if you haven't processed the form, its shows you the form where if you did process the form it would show thanks.I won't go into the differences between asp, php, and cold fusion - that begin to be like talking about politics - everyone has their preference. All in all, asp is popular because microsoft added it to their web server - which is popular due to their "success". PHP is popular because its free and its not microsoft. Cold Fusion is the least popular (unfortunately) mainly becuase the server used to cost a lot and was less accessible the the others. But thats where the conversation on that needs to end in this post - someone can troll that in another topic.But back to the first part of your reply. Here is an example:contactme.cfm
<div class="content"><cfif session.contactme IS "thanks"><strong class="pagetitle">Thanks :.</strong><br /><cfset session.contactme = "backagain"><cfoutput>I appreciate you taking the time to contact me. I will do my best to get in touch with you as soon as possible.  If I do not get back to you with in 48 hours, please feel free to leave a message on my cell phone by calling #session.cellphone#.<br /><br />Talk to you soon<br /><br /></cfoutput><cfelseif session.contactme IS "backagain"><strong class="pagetitle">Hi Again :.</strong><br />You have already sent a message.  If would like to send another message, please come back in an hour when your site session has expired.  I apologize for the inconvenience, but this helps me keep the spammers from manipulating my website.<br /><br />Thanks again<br /><br /><cfelse><strong class="pagetitle">Contact Me :.</strong><br />Please fill out the form below and include any details about your question or comment in the message area.  I appreciate your time and I will do my best to reply to you as soon as possible.<br /><br /><cfform action="contactme-action.cfm" method="post"><strong class="smallestfont">FULL NAME:</strong><br /><cfinput type="text" name="ctm_fullname" value="" style="width:250px;" required="yes" message="Please tell me who you are."><br /><br /><strong class="smallestfont">YOUR EMAIL:</strong><br /><cfinput type="text" name="ctm_youremail" value="" style="width:250px;" required="yes" message="I'll need your e-mail address to get back in touch with you."><br /><br /><strong class="smallestfont">SUBJECT:</strong><br /><cfselect name="ctm_subject" required="yes" message="Give me an idea why you are contacting me."><option value="">-- select one --</option><option value="Technical Support">Technical Support</option><option value="Commission Inquiry">Commission Inquiry</option><option value="Friendly Hello">Friendly Hello</option><option value="Emergency Issue">Emergency Issue</option></cfselect><br /><br /><strong class="smallestfont">MESSAGE:</strong><br /><textarea name="ctm_message" rows="7" cols="50"></textarea><br /><br /><input type="submit" name="ctm_form" value="SEND MESSAGE" style="width:125px: color:#666666; font-size:10px; font-weight:bold;" /><br /></cfform></cfif></div><br />

contactme-action.cfm

<cfif #cgi.http_referer# CONTAINS "contactme.cfm" AND ISDEFINED("form.ctm_form")><cfmail to="#session.myemail#" from="#form.ctm_youremail#" subject="#form.ctm_subject#" server="#session.mailserver#" type="html"><br>#form.ctm_fullname#<br>#form.ctm_youremail#<br><br>#form.ctm_subject#<br>#form.ctm_message#<br><hr>IP: #cgi.remote_addr#<br>DATE: #now()#<br><br></cfmail><cfset session.contactme = "thanks"><script language="javascript" type="text/javascript">	document.location="contactme.cfm";</script><cfelse><cfoutput><script language="javascript" type="text/javascript">	alert('Invalid Page Request.\nClick OK to continue.');	document.location="#urlused#";</script></cfoutput></cfif>

What you will see in the second codebox is how you take FORM values and use them. There are a couple other things happening here and a couple more that I have pulled out to reduce the length of the code I pasted.If you're not using Cold Fusion this will at least get you to understand the concept.P.S. I'm not using a thank you page in this example. I am posting back to the form page because I have logic there to prevent multiple posts within a certain period of time - to prevent form spammers from hitting my site.

Link to post
Share on other sites
Thats what I describe, a page for teh form, a page to process the form, and a third to say thanks.  Now, many people prefer to make the first page conditional - so if you haven't processed the form, its shows you the form where if you did process the form it would show thanks.I won't go into the differences between asp, php, and cold fusion - that begin to be like talking about politics - everyone has their preference.  All in all, asp is popular because microsoft added it to their web server - which is popular due to their "success".  PHP is popular because its free and its not microsoft.  Cold Fusion is the least popular (unfortunately) mainly becuase the server used to cost a lot and was less accessible the the others.  But thats where the conversation on that needs to end in this post - someone can troll that in another topic.But back to the first part of your reply.  Here is an example:contactme.cfm
<div class="content"><cfif session.contactme IS "thanks"><strong class="pagetitle">Thanks :.</strong><br /><cfset session.contactme = "backagain"><cfoutput>I appreciate you taking the time to contact me. I will do my best to get in touch with you as soon as possible.  If I do not get back to you with in 48 hours, please feel free to leave a message on my cell phone by calling #session.cellphone#.<br /><br />Talk to you soon<br /><br /></cfoutput><cfelseif session.contactme IS "backagain"><strong class="pagetitle">Hi Again :.</strong><br />You have already sent a message.  If would like to send another message, please come back in an hour when your site session has expired.  I apologize for the inconvenience, but this helps me keep the spammers from manipulating my website.<br /><br />Thanks again<br /><br /><cfelse><strong class="pagetitle">Contact Me :.</strong><br />Please fill out the form below and include any details about your question or comment in the message area.  I appreciate your time and I will do my best to reply to you as soon as possible.<br /><br /><cfform action="contactme-action.cfm" method="post"><strong class="smallestfont">FULL NAME:</strong><br /><cfinput type="text" name="ctm_fullname" value="" style="width:250px;" required="yes" message="Please tell me who you are."><br /><br /><strong class="smallestfont">YOUR EMAIL:</strong><br /><cfinput type="text" name="ctm_youremail" value="" style="width:250px;" required="yes" message="I'll need your e-mail address to get back in touch with you."><br /><br /><strong class="smallestfont">SUBJECT:</strong><br /><cfselect name="ctm_subject" required="yes" message="Give me an idea why you are contacting me."><option value="">-- select one --</option><option value="Technical Support">Technical Support</option><option value="Commission Inquiry">Commission Inquiry</option><option value="Friendly Hello">Friendly Hello</option><option value="Emergency Issue">Emergency Issue</option></cfselect><br /><br /><strong class="smallestfont">MESSAGE:</strong><br /><textarea name="ctm_message" rows="7" cols="50"></textarea><br /><br /><input type="submit" name="ctm_form" value="SEND MESSAGE" style="width:125px: color:#666666; font-size:10px; font-weight:bold;" /><br /></cfform></cfif></div><br />

contactme-action.cfm

<cfif #cgi.http_referer# CONTAINS "contactme.cfm" AND ISDEFINED("form.ctm_form")><cfmail to="#session.myemail#" from="#form.ctm_youremail#" subject="#form.ctm_subject#" server="#session.mailserver#" type="html"><br>#form.ctm_fullname#<br>#form.ctm_youremail#<br><br>#form.ctm_subject#<br>#form.ctm_message#<br><hr>IP: #cgi.remote_addr#<br>DATE: #now()#<br><br></cfmail><cfset session.contactme = "thanks"><script language="javascript" type="text/javascript">	document.location="contactme.cfm";</script><cfelse><cfoutput><script language="javascript" type="text/javascript">	alert('Invalid Page Request.\nClick OK to continue.');	document.location="#urlused#";</script></cfoutput></cfif>

What you will see in the second codebox is how you take FORM values and use them.  There are a couple other things happening here and a couple more that I have pulled out to reduce the length of the code I pasted.If you're not using Cold Fusion this will at least get you to understand the concept.P.S.  I'm not using a thank you page in this example. I am posting back to the form page because I have logic there to prevent multiple posts within  a certain period of time - to prevent form spammers from hitting my site.

If I am using ".php" or ".asp" instead of coldfusion, whould I just change the tags to reflect the proper script? How do I put in the email address that I want the form info to be sent to? Thanks for all your help. I am going to try some of those codes when I get a chance.
Link to post
Share on other sites
If I am using ".php" or ".asp" instead of coldfusion, whould I just change the tags to reflect the proper script?  How do I put in the email address that I want the form info to be sent to?  Thanks for all your help.  I am going to try some of those codes when I get a chance.

The languages are quite different, so its not quite as easy in asp or php as it seems in cold fusion. Generally speaking, the concept and work flow is the same logic. In each scripting language the mail function (to, from, and subject) are required so you'll have to find them and substitute what you like.Here is a quick PHP tutorial for sending e-mail:http://www.php-scripts.com/php_diary/122899.php3andhere is one for ASP:http://www.sitepoint.com/article/sending-email-aspThose should help you more specifically.I'd recommend setting your destination e-mail address to a session variable. If you define it in a hidden field or even on your action page - it will be very easy for a spam spider to pick it up.
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...