Jump to content
Sign in to follow this  
Nico Kobes

Mail to the wrong mail address

Recommended Posts

A client of ours started yesterday a mail loop. For one mail it went wrong. A person gets a extra mail that was generated for a person that should have get his mail. What I discovered is that person two had a invalid mail address (yes I should check this better in the script) but the mail was send to person one.

What I do in the script:


- I set a local variable $to to the mail address.

- I set the $from, $to, $subject, $body

- I do EmailRegister and EmailConnectSMTP

Then I do:

EmailCreate( $from ; $to ; $subject ) and EmailSetBody( $body; "html" ) and EmailBCCRecipients ( "administratie@xxxx.nl")

- I add Attachments with EmailAttachFile

- And then a EmailSend

- And then EmailDisconnect


I know I should have checked for a vallid mail address but I use a local variable in the script, how can the second mail end up with the previous mail address? 

Share this post

Link to post
Share on other sites

Without debugging the script, I can only speculate as to what is happening. First, definitely add error capturing to your script that captures and records errors and then exits the script if an error occurs. If adding error capturing does not prevent this from happening, I recommend debugging through the script and making sure that EmailCreate is getting the expected input. The plugin can only check validity of an email address by making sure that it follows the format "name@domain.com" ( or whatever the top level domain is .com,.gov,.edu, etc). If there is no "@" or the domain is malformed then the plugin will throw an error but if it meets the format requirements, it will treat it as valid even if that email address doesn't actually exist.  Additionally, if you are looping through records and then setting local variables with field references, if possible, I'd suggest removing that part and using the filed references directly in your function call instead setting local variables, this just simplifies the script and makes it easier to debug. If you continue to have the issue after doing these things, go ahead and reproduce the issue and send your logs to support@360works.com and reference this thread. If you have a testing solution that reproduces the issue, that will help in expediting the support process. Log locations can be found here.

Share this post

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.
Note: Your post will require moderator approval before it will be visible.

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.

Sign in to follow this  

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.