# FormMail not sending to hyphenated domain name address



## oldcelt (Jan 28, 2008)

I hope some formmail guru may be around this forum. I've tried posting messages on the Tectite forum and it's like chucking bricks into a bog!

The problem I'm experiencing is this:-

I can set up and test formmail using the format $TARGET_EMAIL=array("^[email protected]\.com$");.

If I amend it to include a domain which is hyphenated: e.g. $TARGET_EMAIL=array("^[email protected]\.com$", "^[email protected]\.com$"); the second address doesn't receive the email.

Anybody know the answer to this please?


----------



## JiminSA (Dec 15, 2011)

The only thing I can suggest is that you do away with declaring your "TO" field as an array and use a literal without the fancy symbols viz:-

```
"[email protected],[email protected]"
```
This way you get to specify the comma between the addresses, which is the correct delimeter acceptable as per php.net


----------



## oldcelt (Jan 28, 2008)

Unfortunately, the format is defined by the FormMail package. I can't re-write the whole of FormMail since it would nullify the purpose of using it in the first place. I think there must be some element that I'm missing. I've never had a problem with FormMail which I've used several times in the past so this is very puzzling.

Thank you for taking the trouble to suggest an answer - much appreciated.


----------



## JiminSA (Dec 15, 2011)

Maybe you could contact FormMail and ask them the correct array format for multiple recipients?


----------



## oldcelt (Jan 28, 2008)

JiminSA said:


> Maybe you could contact FormMail and ask them the correct array format for multiple recipients?


If only I could get a response!

Their help web site gives details of how to set it up and, as far as I can see, I've done that. Why I'm having a problem I donb't know.


----------



## JiminSA (Dec 15, 2011)

There is a "submit a support request" on a FAQ page which (if you haven't already) may be worth a try?


----------



## oldcelt (Jan 28, 2008)

Not the right formmail. The one I use is that supplied by Tectite.com and is a developed version of the original script.


----------



## JiminSA (Dec 15, 2011)

> You can purchase guaranteed support from the authors and get a real response from a real person!


I saw this on their website and deduce that they'll probably ignore comms from non-payers ...
Have you considered *doing your own* form and email - I encourage you to think about it and remember, we are here to help and advise ...


----------



## oldcelt (Jan 28, 2008)

JiminSA said:


> I saw this on their website and deduce that they'll probably ignore comms from non-payers ...
> Have you considered *doing your own* form and email - I encourage you to think about it and remember, we are here to help and advise ...


TVM. Yes, I was aware of their subscription support but it costs an arm and a leg! This should be easily resolved as I've used the script a dozen times before with no problems. I really appreciate your advice and offers of help but, as I say, this one must be something stupid on my part that I'm overlooking. 
Ken


----------



## JiminSA (Dec 15, 2011)

Sorry oldcelt, I have rather ignored your original problem and having reread it may have a possible solution ...
The original php ...

```
$TARGET_EMAIL=array("^[email protected]\.com$", "^[email protected]\.com$");
```
try amending it so ...

```
$TARGET_EMAIL=array("^[email protected]\.com,$", "^[email protected]\.com$");
```
I don't understand the usage of the ^ and $ symbols, but this ought to put a comma after the first recipient, which should make it a legit "TO" parameter. Give it a try!? nothing ventured ....


----------



## oldcelt (Jan 28, 2008)

From formmail notes:-
Strings entered into TARGET_EMAIL contain "patterns". ^ means the beginning; we want email user names to match only at the beginning of the input. . (dot or period) - matches any single character. \ stops the following character from being a pattern matcher. $ matches the end.

Hope that clarifies the pattern matching symbols?
I'll give your suggestion a try - thanks.


----------



## oldcelt (Jan 28, 2008)

Further testing throws up something more incomprehensible. To keep matters as simple as possible I've tried just using a single email address instead of several in the array.
"[email protected]" works;
"[email protected]" fails! 
Similarly, any other email address fails!
This should be impossible and I just wish somebody in the Tectite forums would comment.


----------



## JiminSA (Dec 15, 2011)

Weird!
Did you try 2 recipients in the array, with the comma included at the end of the first address (.com,)? If so did it graft?


----------



## oldcelt (Jan 28, 2008)

JiminSA said:


> Weird!
> Did you try 2 recipients in the array, with the comma included at the end of the first address (.com,)? If so did it graft?


Tried it - no joy - which is why I reduced the array to a single entry. It makes it even more ridiculous. It seems that the answer should be obvious but it's certainly eluding me!


----------



## JiminSA (Dec 15, 2011)

> Further testing throws up something more incomprehensible. To keep matters as simple as possible I've tried just using a single email address instead of several in the array.
> "[email protected]" works;
> "[email protected]" fails!
> Similarly, any other email address fails!
> This should be impossible and I just wish somebody in the Tectite forums would comment.


FMI - is the second a valid email address? (Maybe they have a built-in checking system?)


----------



## oldcelt (Jan 28, 2008)

JiminSA said:


> FMI - is the second a valid email address? (Maybe they have a built-in checking system?)


The form is on a client's domain. All the email addresses being used for testing are on my domain - i.e. created by me for the purpose. I also have several other personal email addresses which work regularly for normal emailing but also fail in this test.


----------



## JiminSA (Dec 15, 2011)

It's just not logical that it will do an initial send and not subsequent (differently addressed) sends in single mode, let alone the software's apparent inability to do multiple sends, is it? We really need to communicate with the designers to find a solution, I'm afraid, OR maybe use another free 3rd party service who are prepared to communicate with non-pay clients.


----------



## oldcelt (Jan 28, 2008)

I know it doesn't make sense, especially since I've used it on at least half a dozen different client sites successfully. It is, as you say, totally illogical, but it's happening. I'm at my wits' end on this.


----------



## JiminSA (Dec 15, 2011)

I wanna get to the bottom of this if it kills me! Could you post the entire html and php scripting? 'Cos I'm working blind here and may well come up with a fix if I can see the whole picture ...


----------



## oldcelt (Jan 28, 2008)

Thanks very much. It's at the end of my working day and I'll check tomorrow what I can put up without compromising client confidentiality.
I can't tell you how much I appreciate your interest and help.
Ken


----------



## oldcelt (Jan 28, 2008)

JiminSA said:


> I wanna get to the bottom of this if it kills me! Could you post the entire html and php scripting? 'Cos I'm working blind here and may well come up with a fix if I can see the whole picture ...


Well, you can have a laugh at my expense. I hadn't worked on this particular site for about a year and, at that time, I must have been rather careless. As well as the version of formmail held in a sub-folder (accessed by the HTML form) I left a copy in the root folder. 
Needless to say, I kept altering the root folder copy and not the functional one!

That has solved the ridiculous problem with being unable to change a single address. However, it is still failing to send emails to any address in the array which is not in position 1. I can swap any of the array addresses to position 1 and the email arrives.

I hope the solution to this is not as embarrassing as the first one!


----------



## JiminSA (Dec 15, 2011)

Try it now, with the comma separator, suggested earlier in our diatribe?


----------



## oldcelt (Jan 28, 2008)

JiminSA said:


> Try it now, with the comma separator, suggested earlier in our diatribe?


Well, my friend, again I have been stupid. I think I'm getting too old and senile to keep on working in this field. This is the answer (HTML form element):-

NOT as I did to precipitate the problem which was:-

Note the extra inverted comma at the end of the first address and another at the beginning of the second! What an idiot! 

My heartfelt thanks to you for your patience and encouragement and my apologies for having wasted so much of your valuable time.

Ken


----------



## JiminSA (Dec 15, 2011)

> I think I'm getting too old and senile to keep on working in this field.


No Ken, these sort of "woods for trees" occurrences happen to everyone in our field, regardless of age and I'm just glad that it's sorted! Wish we could have started at the html and not the php, though ...


----------



## oldcelt (Jan 28, 2008)

JiminSA said:


> Wish we could have started at the html and not the php, though ...


 You and I both!


----------

