|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
||||
|
||||
|
CFMAIL failing on bad address
Ok, so i hav an automated email that goes out, and its been running really good till today. I just found out that CFMAIlL will bail completely if given a bad email address. Beyond having to validate all the email address that i want to feed thru CFMAIL, is there any other way to handle this?
Thanks
__________________
The liver is evil and must be punished! |
|
#2
|
||||
|
||||
|
Anyone?
Let my state that its not a bad address (like who!@ where.asdf) its a validly formatted address, but the mailbox does not exist. Last edited by Ebot : May 2nd, 2008 at 02:29 PM. |
|
#3
|
|||
|
|||
|
What version of CF are you on? Also, when you say it "blows up", do you mean it stops processing everything (assuming you're feeding it a query)? As far as I know emails that can't be sent via the target SMTP server should end up in the unsent mail folder. Are you sure you aren't actually using the email addresses in the CFMAIL tag to authenticate to the STMP server? Because yes, in that case, if it gets to an invalid address it's going to blow up. Your best bet here is to set up an account that just sends email on the server and use that to authenticate in the CFMAIL tag.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#4
|
||||
|
||||
|
Well, my blow up has expanded to two possible outcomes. When i have the problem on one of my servers, it get an exception error. When i am testing on my local machine (with a hardwired list), it just stops processing.
The format of the email address is good (i build them) and i verify the user name. Maybe the only odd thing i am doing, is that instead of just looping thru the query and sending a seperate email for each user, i am building a list in a variable and then using one cfmail tag to send to everyone. I have tried switching it single emails per user, but the same problem exists (however, that seems to be when i get no error). Overall, if a properly formatted nonexistent email is sent, no mail will be sent (even to the good inboxes) Here is an example of what i am doing: Code:
<cfquery name="CheckforData" datasource="ARDCA"> SELECT STAFF, STAFF_2, STAFF_3 FROM USERS </cfquery> <cfset People = ''> <cfoutput query="CheckforData"> <cfif CheckforData.currentrow eq 1> <cfset People = #Staff# & '@where.com'> <cfelse> <cfset People = People & ',' & Staff & '@where.com'> </cfif> <cfif Staff_2 NEQ ''> <cfset People = People & ',' & Staff_2 & '@where.com'> </cfif> <cfif Staff_3 NEQ ''> <cfset People = People & ',' & Staff_3 & '@where.com'> </cfif> </cfoutput> <cfif CheckforData.recordcount neq 0> <cfoutput> <cfmail type="html" to="#People#" from="me@where.com" subject="test" server="smtp.where.com"> <cfinclude template="myfile.cfm"> </cfmail> </cfoutput> </cfif> I'm running version 7,0,0,91690 |
|
#5
|
|||
|
|||
|
Have you tried it using the query attribute instead of building up a list of names like that?
|
|
#6
|
||||
|
||||
|
I haven't tried using it with the cfmail tag, but i have tried doing a cfoutput around the tag so an email is sent out for each record.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > CFMAIL failing on bad address |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|