Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#121 2007-12-10 20:56:27

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: zem_contact_reborn 4.0.3.20

the_ghost wrote:

Is it possible to create with javascript new fields within zem’s form?

You could put them into the HTML form on the page, but the plugin wouldn’t process them. They’d only be useful for client-side processing (i.e. an e-mail validation form that has to match the zem_contact_reborn e-mail field). That kind of JS validation can’t always be counted on, however.

Offline

#122 2007-12-10 22:38:20

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: zem_contact_reborn 4.0.3.20

Maybe this post on Mathew Smith’s (ma smith on the forum) site might be helpful to you.

Offline

#123 2007-12-12 20:18:51

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 256
Website

Re: zem_contact_reborn 4.0.3.20

My missing emails issue trundles on.

On page 9, ruud wrote:

Gary, you need the help of your webhost to debug this. Have them look at the mail server log files to see what happens to the emails that ZCR/PHP sends. The actual SMTP connection is outside the view of ZCR; that’s between PHP and the mailserver… or even one step further.

After a couple of weeks of prodding by our web-hosts, they come back with:

From this we know that email when properly addressed will be sent and recieved. We can also tell that there is no server conflict stoppping mail being delivered from gladstone to mail.artdemous.com. As you have said, the problem is that the server is assigning the sender anonymous@gladstone.soho.aussiehq.net.au, and is being rejected as it is not the email address of the sender. The server will only do this if it does not recieve a return address in the correct format. If the form was presenting this information in the correct manner, the suppied return address would be used.
We have checked and tested our systems and have found no reason to suspect the server is doing anything unusual with regard to this form. As it is only emails generated by this script, and indeed only some of the email generated by this script that have a problem, by elimination it must be an issue with the script itself, as far as we can see.

and then finally with this:

The return-path is included by the sending MTA, and can be specified via the “-f” switch in sendmail or as “MAIL FROM” if communicating directly with the SMTP server. The return-path is therefore set by the PHP script responsible for the message, and is only set to the default address (in this case anonymous@gladstone.soho.aussiehq.net.au) if it isn’t specified.
This is the reason that I believe that the plugin is responsible for the problem and not the server. That being said, if you or the developer can provide a technical reason why you believe the server is responsible (especially something showing the script specifying the return-path), then I will be more than happy to look further in to this.

“-f” switch? That all shoots above my head! Ruud, can you shed any further light on this?

Thanks!

Offline

#124 2007-12-12 21:17:32

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.20

If you hardcoded the return-path in the PHP script, it should either work or not work…. not sometimes work.

That “-f” trick is only used if your script directly calls the sendmail binary to send email. PHP scripts don’t do this; they use the built in mail() function. Neither do they communicate directly to the mailserver on port 25 to manually do a SMTP handshake (the “MAIL FROM” thing they’re referring to.

http://nl2.php.net/function.mail

Note: When sending mail, the mail must contain a From header. This can be set with the additional_headers parameter, or a default can be set in php.ini.
Failing to do this will result in an error message similar to Warning: mail(): “sendmail_from” not set in php.ini or custom “From:” header missing. The From header sets also Return-Path under Windows.

ZCR does set the “From” header when calling the mail() function. It does not set the Return-Path, nor should it. The fact that PHP deems it necessary to do this on Windows platforms is probably related to some Exchange peculiarity (read: not sticking to RFC). They really should read this:

http://rfc.net/rfc2821.html#s4.4

When the delivery SMTP server makes the “final delivery” of a message, it inserts a return-path line at the beginning of the mail data. This use of return-path is required; mail systems MUST support it. The return-path line preserves the information in the <reverse- path> from the MAIL command. Here, final delivery means the message has left the SMTP environment.

Note the word “final” here… while your webhost’s SMTP server is definitely not the final mailserver in the delivery process.

The reverse path address (as copied into the Return-path) MUST be used as the target of any mail containing delivery error messages.

Which means that it should be a valid email address… and anonymous@gladstone.soho.aussiehq.net.au neither exists nor does it deliver error messages to the person who could do something about it (you):

telnet gladstone.soho.aussiehq.net.au 25
Trying 203.88.122.16...
Connected to gladstone.soho.aussiehq.net.au.
Escape character is '^]'.
220 gladstone.soho.aussiehq.net.au ESMTP
HELO example.com
250 gladstone.soho.aussiehq.net.au
MAIL FROM <me@example.com> 
250 ok
RCPT TO <anonymous@gladstone.soho.aussiehq.net.au>
550 sorry, no mailbox here by that name. (#5.7.17)

Offline

#125 2007-12-12 21:28:09

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 256
Website

Re: zem_contact_reborn 4.0.3.20

Thanks again, Ruud: another quick, cogent response from you…

Hopefully this will persuade ‘em!

Offline

#126 2007-12-14 19:29:34

typeshige
Member
From: USA
Registered: 2005-08-11
Posts: 151
Website

Re: zem_contact_reborn 4.0.3.20

I want to use this plugin to write to a table in my database after everything checks out and it’s ready to actually send mail.

I’m reading through the plugin now, but I figured I’d ask which spot in the code does this occur. And if there is some functionality built-in that makes it possible to extend this plugin to do some more processing before mailing without hacking this nice plugin.

I figured I’d put my code in the block after line 229:

229: if (mail($to, $subject, $msg, $headers))

Thanks for this great plugin

Last edited by typeshige (2007-12-14 19:33:53)

Offline

#127 2007-12-14 19:40:10

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: zem_contact_reborn 4.0.3.20

@typeshige: You could save yourself a lot of trouble by using the zem_contact_reborn API to write an extension to the plugin. This will keep your special-purpose code separate from the main plugin, and make future upgrades easier. Look for more info and an example at the bottom of the ZCR documentation.

Offline

#128 2007-12-14 19:59:32

typeshige
Member
From: USA
Registered: 2005-08-11
Posts: 151
Website

Re: zem_contact_reborn 4.0.3.20

@Logoleptic: That’s exactly the functionality I was looking for. I have to admit, I only got halfway through the well-written docs before shooting off my question.

Thanks,
Shige

Offline

#129 2007-12-17 13:21:22

psimsy
Member
From: Londinium
Registered: 2004-12-27
Posts: 13

Re: zem_contact_reborn 4.0.3.20

Hello. I have been through the forum & plugin help but am struggling with this one…

I need get ZCR to put some of the selection fields INTO the subject line of the email.

eg. The form asks for 2 sets of dates and I want to be able to see the sets of dates as the email subject to help organise the mails.

I have tinkered with using the ‘subject_form’ but with no success has anyone tried doing this?
Is there a way to get ZCR to put form content into the subject line?

i hope so..
psimsy

Offline

#130 2007-12-17 17:58:47

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: zem_contact_reborn 4.0.3.20

@psimsy: Check out the portion of the help that deals with offering a user-selectable subject field. You’ll be doing something similar. Let’s say your date fields are called date1 and date2, and you want to show them as a range separated by a hyphen and followed by an indication of where the message came from.

<txp:php>
  global $zem_contact_form;
  echo $zem_contact_form['date1'] . ' - ' . $zem_contact_form['date2'] . ' via my contact form';
</txp:php>

Give that, or something like it, a try. I’m pretty sure it’ll get you what you want.

Offline

#131 2007-12-22 06:24:44

darock
Member
Registered: 2007-11-23
Posts: 54

Re: zem_contact_reborn 4.0.3.20

As you can see from my page here , my labels aren’t properly aligned with my input fields, specifically the email and describe/list items labels.

I’m also getting the word “contact” to appear twice.

How do I solve these issues?

My code in my form looks like this;

<txp:zem_contact to="xxx@gmail.com">
  <txp:zem_contact_email required="1" break="" />
  <txp:zem_contact_text label="Full Name" name="Name" required="1" min="2" max="40" break="" />
  <txp:zem_contact_text label="Phone" />
  <txp:zem_contact_textarea label="Describe/list items" cols="40" rows="10" break="" />
  <txp:zem_contact_submit label="Submit" />
</txp:zem_contact>

Offline

#132 2007-12-22 07:13:22

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: zem_contact_reborn 4.0.3.20

darock,

First lets take the label away with adding label=""-attribute to the txp:zem_contact-tag.

<txp:zem_contact to="xxx@gmail.com" label="">

Secondly, the wrong align is caused by your styling and output, as you don’t use break-tag nor CSS with that form. Which causes that everything is outputted to one single line, but because everything doesn’t fit the column, it breaks that way. Solution is that you use break tags that will wrap the content or you could use CSS, ie:

.zemContactForm label {
display: block;
}

Cheers!

Offline

Board footer

Powered by FluxBB