Technology Tools for Ministry

Community

Web-Empowered Church User Community
All Categories > Ministry Tools > Servant Matcher Extension > Error sending emails in class.tx_wecservant_pi1.php on line 1846
Total Posts: 8 - Pages (1): [1]
Author: Jonathan Uhlmann
Posted: Jun 18 2007 - 08:39 AM
Subject: Error sending emails in class.tx_wecservant_pi1.php on line 1846
Hello everyone!

I've a problem sending emails. If I will test the extension and fill out the form, I get always this error:

Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in F:webdataicf.chwwwtypo3confextwec_servantpi1class.tx_wecservant_pi1.php on line 1846

The Ministry has a contact person with a valid email address. I also don't have a emaillink on the contact name in the list of opportunities. Can somebody help me?

Thank you a lot
Jonathan Uhlmann
Author: Dave Slayback
Posted: Jun 18 2007 - 09:08 AM
Subject: re: Error sending emails in class.tx_wecservant_pi1.php on line 1846
Hi Jonathan,

It sounds like your mail configuration is not setup correctly. Have you been able to send out email with other extensions in TYPO3? Or on your server account?

To test what email is being sent, you can add a debug line which will print out the email. You will have to find it -- around line 1846...

// if mail successfully sent, then count it.
debug($toName,"toName=");
if (strlen($toName) && mail($toName, $emailSubject, $sendEmailBody, $headers))
$sentMail++;

Then when you run this, you can see the email-to address. If this is not correct, then that is one issue -- please check your data and if that seems fine, let me know example data. If it is correct, then most likely it is your mail() setup.

If you need guidance about setting up your mail(), let me know what kind of server and OS you use. Also, go to your typo3/install/ tool and in the Configuration is setting some path names and testing your mail.

-Dave
Author: Jonathan Uhlmann
Posted: Jun 18 2007 - 09:47 AM
Subject: re: Error sending emails in class.tx_wecservant_pi1.php on line 1846
Thanks Dave, but it don't print any emailaddress. The mailtest in the installtool works. I also don't have a link to the emailaddress on the contact name in the list of opportunities...
Author: Dave Slayback
Posted: Jun 18 2007 - 10:53 AM
Subject: re: Error sending emails in class.tx_wecservant_pi1.php on line 1846
If you do not have any email links in the contact record, you must set the adminEmail local language link or the "Notify Email" in the Administrator tab of the Flexform. Setting either of these should allow you to get the emails.

For the adminEmail, you can set it by adding this to your extension template (Template->Info/Modify) in the SETUP section:
tx_wecservant_pi1._LOCAL_LANG.default {
adminEmail = myemail@mail.com
}
where you specify your email.

I will add further documentation on this because I see it is not clearly detailed in the manual.

-Dave
Author: Jonathan Uhlmann
Posted: Jul 02 2007 - 06:20 AM
Subject: re: re: Error sending emails in class.tx_wecservant_pi1.php on line 1846
Hi Dave

I get closer to the solution: In Line 1927 in the file class.tx_wecservant_pi1.php there is following code


############## CODE START ##################
if ($contact['name'])
$toName = $contact['name']." <".$contact['emailVal'].">";
else
$toName = $contact['emailVal'];
############## CODE END ####################

I've found out that if the contact person don't have a name stored, the email get send. The code in Line 296 should link the contact Name with the emailaddress. But this don't work too, the name is displayed without a link.

I've got the newest version of the extension.

Sorry for my bad english
Greatings from Switzerland
Author: Dave Slayback
Posted: Jul 02 2007 - 10:38 AM
Subject: re: Error sending emails in class.tx_wecservant_pi1.php on line 1846
Hi Jonathan,

If you look at the top of the for loop (line 1803), you will see it handles if no email...
if (!$contact['emailVal']) {

And it is there that it sets the admin_email local language or the notify_email from the Flexform if that is not configured.

So I am not sure how it would get down to line 1927 -- the contact['emailVal'] has to be set otherwise no email would be sent.

I am wondering if you are getting email sent here such that you have a name, no email address, but somehow the emailVal is set to an empty string? Perhaps it should be a test for if (!strlen($contact['emailVal'])) -- if you can try that, let me know if it works.

-Dave
Author: Jonathan Uhlmann
Posted: Jul 02 2007 - 11:19 AM
Subject: re: re: Error sending emails in class.tx_wecservant_pi1.php on line 1846
Hi Dave

Could you make me a hole test function? I don't know exactly what you mean.

If the ministry contact has no name, it's not shown in the view of the results, but the emails are sent correctly.
But if the ministry contact has name, email, telephone, etc. it just displays the name. I think this is also a wrong behavior. What do you think?
Author: Dave Slayback
Posted: Jul 02 2007 - 02:46 PM
Subject: re: Error sending emails in class.tx_wecservant_pi1.php on line 1846
Hi Jonathan,

I did some tests and found in the default template, you can see email & telephone even if the name is not there. Have you modified the template at all?

As for testing this function and to better understand the problem with email, can you add this debug line to around line 1936:

t3lib_div::debug("toname='".$toName."' contactName='".$contact['name']."' contactEmailVal='".$contact['emailVal']."' contactEmail=".$contact['email']);
if (strlen($toName) && mail($toName, $emailSubject, $sendEmailBody, $headers))
$sentMail++;

Run it, and let me know the results. That will help me to understand what values are there or not.

If you have this on a website I could access, that may help me understand what is going on.

-Dave

Total Posts: 8 - Pages (1): [1]
You must login to post a message to this conference.