CF Mail

I am not receiving my test mails...

Page 1 of 1

2 Replies - 2178 Views - Last Post: 15 February 2008 - 07:34 PM Rate Topic: -----

#1 parenteau  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 12-February 08

CF Mail

Posted 14 February 2008 - 04:44 PM

Hello All!!!
I am still trtying to work out some basics. Here is the email form I am testing on my coldfusion acct. to use in various places on the site. I can't seem to get any emails back though. I want to eventually make the form more complex... but I figured I should try to get this to function first. Anyway, I am having similar problems with my file upload form that I posted a topic on.... no-one has replied to that post yet... these may be similar issues... I havn't figured it out yet. Please forgive me for not understanding this code stuff yet.... once I do, I feel like I will be able to do some really creative stuff. Please help, some day I may be able to return the favor! Thanks.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Contact Us</title><style type="text/css">
<!--
.style2 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 14px;
	color: #333333;
}
-->
</style></head>

<body><CFIF IsDefined("process")>
	 <div align="center">
	   <!--- Send the message to yourself, when the user posts it on your site. --->
	   <CFMAIL to="email@mywebsite.com" from="#ContactEmail#" Subject="mail from mywebsite.com"server="mail.mywebsite.com" port="25" 
username=“emai@mywebsite.com”
password=“emailpassword”>
		#ContactMessage#

		Message By: #ContactName# - #ContactEmail#
		========================================
	   </CFMAIL>
 
		<CFMAIL to="email@mywebsite.com" from="#ContactEmail#" Subject="mail from mywebsite.com" server="mail.mywebsite.com" port="25" 
username=“emai@mywebsite.com” password=“emailpassword”>
		 
		 Thank you for your message,
		 We'll be in touch as soon as we can, we receive hundred and thousands
		 of emails a day; so we might take a while, but we'll reply!
		 
		 Thanks again for visiting our site,
		 Michael Parenteau - Webmaster
		 michael@intuitimaging.com.Com
		 
		 You wrote:
		 #ContactMessage#
		 
		 Message By: #ContactName# - #ContactEmail#
		 ========================================
	   </CFMAIL>

	<table width="600" border="1" cellspacing="5" cellpadding="7">
  <tr bgcolor="#E7E7E7">
	<th width="126" scope="col"><img src="images/AEClogo(web).jpg" alt="" width="198" height="193" /></th>
	<th width="425" valign="middle" scope="col"><div align="center" class="style2">Thank You for your message. We will contact you as soon as possible.
	  <hr size="1" /> <a href="#">Click here to go to the home page</a></div></th>
  </tr>
</table>

	<CFELSE>

	 </div>
	 <cfform action="contact.cfm" method="post">
	<input type="hidden" name="Process" Value="1">
	<table align="center" border="0" width="487">
<tr>
			<td width="20%" valign="top" align="right">Name:</td>
			<td width="80%"><cfinput type="text" name="ContactName" size="20" required="yes" message="Please Enter Your Name!"></td>
		</tr>
		<tr>
			<td width="20%" valign="top" align="right">Email:</td>
			<td width="80%"><cfinput type="text" name="ContactEmail" size="20" required="yes" message="Please Enter Your Email Address!"></td>
		</tr>
		<tr>
			<td width="20%" valign="top" align="right">Message:</td>
			<td width="80%"><textarea rows="4" name="ContactMessage" cols="50"></textarea></td>
		</tr>
		<tr>
			<td width="20%" valign="top" align="right"></td>
			<td width="80%"><input type="submit" value="Submit Contact Form"></td>
		</tr>
	</table>
	</cfform>

</CFIF>
</body>
</html>



Is This A Good Question/Topic? 0
  • +

Replies To: CF Mail

#2 parenteau  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 12-February 08

Re: CF Mail

Posted 15 February 2008 - 06:40 AM

Did I post this wrong or can nobody see the problem here... I can't figure out what I am doing wrong.
Was This Post Helpful? 0
  • +
  • -

#3 sansclue  Icon User is offline

  • D.I.C Regular

Reputation: 29
  • View blog
  • Posts: 316
  • Joined: 21-November 07

Re: CF Mail

Posted 15 February 2008 - 07:34 PM

View Postparenteau, on 15 Feb, 2008 - 06:40 AM, said:

Did I post this wrong or can nobody see the problem here... I can't figure out what I am doing wrong.


As far as I can see there is nothing the code per se. Assuming the email addresses are valid. There are a number of things that can effect whether or not mail works. The most common is firewall software blocking mail.

I do not know if you are running CF locally or using a shared host. If you are running it locally

1) First check the "undelivered folder" to see if your messages are there. By default, undeliverable mail is sent to the mail\Undelivr folder. Example
c:\ColdFusion8\mail\Undelivr

2) If the messages are there, check the error logs. You can view them by logging into the CF administrator or view them directly. By default logs are located in the \logs directory. Example c:\ColdFusion8\logs. Check the application.log and exception.log for mail related error messages.

You might see an error message like this, or at least one that will help indicate the cause.

"Error","scheduler-1","02/15/08","18:19:09",,"Unknown SMTP host: mail.mywebsite.com;   nested exception is: 	java.net.UnknownHostException: mail.mywebsite.com"
javax.mail.MessagingException: Unknown SMTP host: mail.mywebsite.com;
  nested exception is:
	java.net.UnknownHostException: mail.mywebsite.com



3) Which version of CF are you using? The "server" attribute is an Enterprise Edition only feature. Though it should work in the Developer version too. If you are running "Standard" that might explain why it does not work

4) I would try a simple test (ie without all the html form code) just to make it easier to isolate the problem.

<cfset ContactEmail = "testContactEmail@somecompany.com">
<cfset ContactMessage = "Testing message">
<cfset ContactName = "Some One">

<CFMAIL to="email@mywebsite.com" from="#ContactEmail#" 
	Subject="mail from mywebsite.com"
	server="mail.mywebsite.com" port="25"
	username="emai@mywebsite.com"
	password="emailpassword" >

	#ContactMessage#

	Message By: #ContactName# - #ContactEmail#
	========================================
</CFMAIL>


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1