Cancel sending E-mail (or treatment) if the Recordset is empty?

I have the following code which works great to send an email when a new record has been added to the table of tickets. (code of e-mail is not listed)

-Table, called 'sent_email' column begins with a default value of 0

------------------------------------------

< cfquery name = "rsSendEmail" datasource = "loc" >

SELECT tickets.ticketID, tickets.sent_email, tblusers.username and tblusers.username HAVE ownname, tickets.ticket, tickets.original_date, tickets.work_date, tickets.priority, tickets.type, tickets.started, tickets.name, tickets.caller, tickets.contact, tickets.contact_phone, tickets.county, tickets.place, tickets.location, tickets.work_type, tickets.extent, tickets.remarks, tblusers.email, tblusers.firstName AS tickets.street, tblstatus.stDesc, tblusers.lastName, fn

FROM tblstatus RIGHT OUTER JOIN tickets ON tblstatus.stID = tickets.statusID LEFT OUTER JOIN TblUtilisateurs ON tblusers.ID = tickets.ownerID

WHERE tickets.sent_email = '0 '.

LIMIT 1

< / cfquery >

-----------------------------------------

-Once the e-mail goes out, I run this code to update 'sent_email' 1

-----------------------------------------

< cfquery name = "rsSetSentFlag" datasource = "loc" >

UPDATE tickets

SET tickets.sent_email = '1 '.

WHERE tickets.sent_email = '0 '.

LIMIT 1

< / cfquery >

------------------------------------------

I get the first email correctly, but then I keep getting email without data, which are empty?

I think I need to stop 'treatment' the rest of the page if the Select query returns no records.

I tried to add this code below after having received the request, but it stops at the < cfabort line...

< cfif rsSendEmail.recordCount NEQ 0 >

< cfabort showerror = "" >

<!-treatment is interrupted,->

<!--and the following operations are not carried out.-->

< / cfif >

Hello

Give something like this a try.

Run your query and then use to run your process of intrusion via cfmail.

This should work only your intrusion via cfmail process if there is a recordcount, otherwise nothing was happening.

SELECT tickets.ticketID, tickets.sent_email, tblusers.username and tblusers.username HAVE ownname, tickets.ticket, tickets.original_date, tickets.work_date, tickets.priority, tickets.type, tickets.started, tickets.name, tickets.caller, tickets.contact, tickets.contact_phone, tickets.county, tickets.place, tickets.location, tickets.work_type, tickets.extent, tickets.remarks, tblusers.email, tblusers.firstName AS tickets.street, tblstatus.stDesc, tblusers.lastName, fn

FROM tblstatus RIGHT OUTER JOIN tickets ON tblstatus.stID = tickets.statusID LEFT OUTER JOIN TblUtilisateurs ON tblusers.ID = tickets.ownerID

WHERE tickets.sent_email = '0 '.

LIMIT 1

Tags: ColdFusion

Similar Questions

  • cancel sending E-mail

    Hi, I was looking for a way to cancel the sending of email via transport BB:

    message.addMessageListener (this);

    Transport.Send (message);

    the listener metod I'm checkin message status and when ESS (mail service) is off message cannot be sent, BB is trying to send this email several times and after 10 tests, failed to send message is called. thing is that I want to cancel sending e-mail after for example. 3 tests.

    is it possible to do?

    No, there is not a for a third party application to do this that you describe.

  • When sending e-mail message stuck in the Outbox. After a few moments, I get the following error message:

    When sending email-message stuck in the Outbox.  After a few moments, I get the following error message: your server has unexpectedly terminated connection. The possible causes for this include server problems, network problems, or a long period of inactivity. Account: ' * address email is removed from the privacy *', server: 'outgoing.yahoo.verizon.net', Protocol: SMTP, Port: 25, secure (SSL): no, error number: 0x800CCC0F

    Ideas for a solution?

    Thank you.

    This just started today? There are a number of people with Yahoo/Verizon today information system.

    http://forums.Verizon.com/T5/Verizon-net-email/outgoing-mail-not-working-in-Outlook-Express-again/m-p/303901

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-networking/i-cannot-send-emails-thru-Outlook-Express-6-the/9a518480-b86b-E011-8dfc-68b599b31bf5

  • Cannot send e-mail error delivery to the following recipient failed permanently

    I tried to send a mail-donkey for a few days now, but I receive the following message:

    Delivery to the following recipient failed permanently:

    microsofthelpdesk@Microsoft.

    Technical details of permanent failure:
    Google has tried to convey your message, but it was rejected by the server for the domain microsoft.com recipient by microsoft - com.mail.protection.. [207.46.163.138].

    The error that the other server returned was:
    550 5.4.1 [microsofthelpdesk@microsoft.]: recipient address rejected: access denied

    What really bothers me is that I've searched for a solution but I think is to wave to me.

    It would be useful that I had a detailed explanation about the error 550 5.4.1 and how to solve this problem.

    It is not a valid email address or it will not be detected.  Care to tell us what is your original problem.

  • Send e-mail when someone takes the quiz

    I have my quiz put in place so that the results are displayed in my internal server so I can use quiz monitor to access the results. Is there any way I can receive an e-mail when someone passes the test so I can't check the Analyzer quiz to see who did the test?

    Captivate allows you to trigger an email via advanced Actions.  However, this best open a new email in the email client of the user with some default of the text of the object and your e-mail address.  You are still reliant on the user manually send this e-mail.  This makes it unreliable itself.

    To get an automated e-mail, you must have access to the web programming skills to create a page server who sent an e-mail when it is called.  The Captivate course participant would then no conscience of enamel.

  • When I send a mail it remains in the outgoing message, while in fact it will have been delivered without my knowledge

    When I send an e-mail message, I noticed that he stayed in my "Outbox". But in reality it would have been delivered. While I try to send it again it will be delivered without my knowledge, and the recipient will be received in several numbers.

    You left out the important part. What type of program you use for mail?
     
     
    If it's Outlook Express, you have a dbx file corruption. Create a new Outbox and sent items folder.
     
     
    Follow these steps for the Outbox and sent items after you move the messages you want to save to a local folder that you create.
     
    Tools | Options | Maintenance | Store folder will reveal the location of your Outlook Express files. Note the location and navigate on it in Explorer Windows or, copy and paste in start | Run.
     
    In Windows XP, the files of user OE (DBX and WAB) are by default marked as hidden. To view these files in Windows Explorer, you must enable Show hidden files and folders under start | Control Panel | Folder Options icon | Opinion, or in Windows Explorer. Tools | Folder options | View.
     
    With OE closed, find the Outbox.dbx and Sent Items.dbx file and remove them. New files will be created automatically when you open OE.
     
     
     
    To avoid this in the future:
     
    Do not archive mail in the receipt or sent items box. Create your own user-defined folders and move messages you want to put in them. Empty the deleted items folder daily. Although the dbx files have a theoretical capacity of 2 GB, I recommend all a 300 MB max for less risk of corruption.
     
    Information on the maximum size of the .dbx files that are used by Outlook Express:
    http://support.Microsoft.com/?kbid=903095
     
    After you're done, followed by compacting your folders manually while working * off * and do it often.
     
    Click Outlook Express at the top of the the folder tree so no folders are open. Then: File | Work offline (or double-click on work online in the status bar). File | Folder | Compact all folders. Don't touch anything until the compacting is completed.
     
    Disable analysis in your e-mail anti-virus program. It is a redundant layer of protection that devours the processors and causes a multitude of problems such as time-outs and account setting changes. Your up-to-date A / V program will continue to protect you sufficiently. For more information, see:
    http://www.oehelp.com/OETips.aspx#3   
  • Problems sending/receiving mail - error number: 0x800CCC0E - "the connection to the server has failed..." »

    De : Briangie

    I've been out of town for a few days. I was using a public Wi - Fi connection to my laptop. The first part of the week worked fine, but now using the same wireless connection, I receive the following error message. Has happened since yesterday afternoon 03/10/08 and today is 05/10/08. What is the problem? Help, please!

    The connection to the server has failed. Account: 'mail.charter.net', server: 'mail.charter.net', Protocol: POP3, Port: 995, secure (SSL): Yes, Socket error: 10060, error number: 0x800CCC0E

    From: Gary van

    In Windows Mail, go to the tolls, accounts, select the account mail.charter.net, properties, advanced. Change the port number for the incoming (POP3) server from 995 to 110. Make sure that the adjacent SSL option is not checked. Click OK.

    As a general rule, the owner of the SMTP server must be the same that provides your Internet connection at the moment.

    The workarounds available when sending abroad are the following:

    1. use webmail to send (via your browser).
    2. ask your ISP if they have one port other than '25' for SMTP. I do not think that
    Charter of fact. Cable companies are very difficult to accommodate travellers.
    3. If you frequently use the same connection away from home, replace the SMTP Protocol
    Server in this respect. It's a little tricky, but if you want to go this route.
    I can provide more details.
    4. If you frequently send to multiple locations, get a free Gmail account,
    Configure it to POP access and use for your shipment of household chores.
    Gmail uses port 465 for SMTP, which is not blocked as is port 25.


    Another response of the community of Windows Vista discussion groups

  • Remove the snapshot from the server and then send a mail to me when the work is finished.

    Hi all

    Could someone help me with a script that would do this?

    Concerning

    Tyler

    This goes in the direction of what you are looking for?

    $snaps = Get-VM | Get-Snapshot
    Remove-Snapshot -Snapshot $snaps -Confirm:$false
    
    $emailFrom = "[email protected]" $emailTo = "[email protected]" $subject = "All snapshots are removed" $body = $snaps | select VM,Name,Created,SizeMB | ft -AutoSize | Out-String $smtpServer = "smtpserver"
    $smtp = new-object Net.Mail.SmtpClient($smtpServer)
    $smtp.Send($emailFrom, $emailTo, $subject, $body)
    
  • Shows bad Contacts in the field when sending electronic mail, but not in the contacts list, so I can't delete them

    When I press the 'to' on the e-mail domain, all my contacts appear. However, at the end of the show 5 contacts list that are not my contacts! I checked my list of contacts and they do not appear. So so I can't delete them. My question is, how to remove? I took a page if someone wants to see it. Any help will be appreciated.

    I'm going to assume that contact names you see may be something you do not want to reveal, perhaps something like "Drunkgirlroom".

    It is a waiting Group network Invitation causing your problem. To resolve this issue, you must decline the Invitation by following these steps:

    1. click on Contacts.
    2. click on discovers invitations.
    3. click on groups.
    4. click on No, thank you.

    For reference, see the following:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-security/found-unauthorized-names-on-my-Hotmail-contact/1d8c122f-2f7a-E011-9b4b-68b599b31bf5

    I hope this helps.

  • Not all of a sudden, I can't send e-mail

    I can't send email, but I can receive. He always tells me that my password is incorrect, but it IS OK on my computer and if I connect via safari. What should I do? I need to be able to send e-mails!

    Check the outgoing mail server setting. Make sure that your user name and password are there.

    Settings > Mail, Contacts, calendar > your account > account > outgoing mail server - tap the name of the server next to SMTP check in the main server and make sure that your user name and password are entered and correct - even if it says that the password is optional.

  • Windows Live Mail stopped sending e-mail.

    Windows Live Mail stopped sending e-mail.  I get the electronic error which indicate that the size of the e-mail is too large, even with a single recipient.  I also get a 552 error code.  My ISP says it's a problem of Windows Live Mail, but Microsoft is not going to help me.

    Windows Live Mail is supported in this forum
    http://answers.Microsoft.com/en-us/windowslive/Forum/LIVEmail?tab=all

  • See the region if the recordset field is (not) "null."

    Facing another problem. The solution is probably going to be very simple, but so far I have not thought of her. That's what I'm looking for:

    Say you have a page with the title, the introduction of message and a news reading, more button. The table in which the ballots are stored got 5 columns:

    • ID (primary key, I)
    • date_entry (timestamp)
    • newstitle
    • newsintroduction
    • newsmessage (may be NULL)

    As you can see, the "newsmessage" column can be NULL because sometimes there are short messages. What I want to know is, if the "newsmessage" column is null, on the page that displays the records of news, the link "read more" should not be visible. It should show only when the "newsmessage" column is "not null", so got content inside.

    Thank you!

    Is this really a region you want to show or hide? I guess it could be, but DW normally like it better when the "region" is its own row of the table. I don't know how much time, even when I do not select the TR tag in the property inspector and apply a show or Hide Server behavior, DW still places the code inside the TR tag in the source code.

    So, basically, want you want to do is wrap the a tag that contains the text read more, in an If statement. I don't have the exact syntax for you, my PHP skills are still developing. Maybe an other people could help - or if you do not have a behavior show or hide (when the recordset is empty or non-empty), take a look at the way this code is structured and use it as a guide. But if you use Null/Not Null as your requirement, make sure that the field contains a null value.

  • See the region if recordset is empty

    Hello
    I modified the 'see the region if recordset is empty' to make it 'see the region if the field in the recordset is empty. but for some reason, it doesn't seem to work. did I do it correctly?

    Ive pasted my code below


    < cfif rsLatestNews.image EQ 0 >
    "< img src =" images/dvdNoFlash.jpg"alt ="other pictures"name ="image1"width ="87"height ="92"="image1"id / > < img src =" images/dvdNoFlash.jpg "alt ="other pictures"name ="image2"width ="87"height = id ="92""image2"/ > < img src =" images/dvdNoFlash.jpg"alt ="other pictures"name ="3"width ="87"height ="92"id ="3"/ >"
    < / cfif >

    Wednesday, December 20, 2006, 17:33:47 + 0000 (UTC), ' * mista. "
    wrote:

    > What happens if there is more than one set of records released by your query.

    Just FYI, a recordset is the Group of zero, one or more of the records returned by a
    query. To have more than one Recordset, you need more than one
    query.

    I don't know enough about CF offer much by way of
    suggestions, but my suspicion is that the test is wrong:

    I doubt that the image field is numeric. Unfortunately, I do not know what is
    returned by CF of an empty field. I would say something like that
    might work:

    However, if CF returns a value, you may need to test for this as
    Well.

    Gary

  • Thunderbird on Windows 8.1 sends a message without error, but the mail is not delivered.

    New laptop Toshiba current A6 running Windows 8.1. Installed Thunderbird 31.6.0. Configuration completed successfully. Am able to receive the mail, but cannot send. When I send mail, I see the message "connecting to Server" and "mail sent successfully." I DON'T GET ANY KIND OF ERROR MESSAGE. Mail is never with the server.

    The automatic configuration of Thunderbird sets out to "SMTP.lakeland.ws" port 587 server. After several failed attempts to send a mail to "[email protected]" myself, I've reconfigured the SMTP outgoing, based on the configuration of my Windows 7 Windows Live Mail on another laptop: "mail.airstreamcomm.net" Port 25.

    When I sent mail with this setup I was prompted for the password for my mail server. I gave the password and mail appeared to send. NO ERROR MESSAGE and mail went to the sent queue. Subsequent attempts seem to send the email with the MESSAGE of NO ERROR but never gets the mail on the server Lakeland.ws .

    I then remove the account from Thunderbird and launched the automatic sequence of configuration to set the settings back to the original configuration. Still have the problem

    Help, please!

    Try to send a mail to [email protected]. I will answer you if I understand, and I think I'll

  • I can only send email as attachments, not to the normal e-mail format

    Last week I sent a Word attachment by e-mail and eventually all the e-mails I send appear as attachments. I want to forward emails in the format of ordinary e-mail, so I can see the content that I send, and so the recipient doesn't have to open an attachment. I use Windows 7 on a desktop computer. Thanks in advance!

    From the menu bar select Tools-Options-Composition-General

    The first option the value Inline or room attached?
    Inline , it is what you want.

    No Tools menu bar? Press the ALT key.

Maybe you are looking for