brink668
Posts: 11
|
| Posted: 04/18/2009, 8:16 PM |
|
Hi, I have been testing this product for a few days, I have created some test pieces. Anyhow I tried an example, and I was using the example to build an email event.
What I want the emailer to do:
When a user registers I want to get a notification that a new entry has been submitted to the database.
But, I have having problems everytime I want to send an email out. I want the email to go to:yourdomain@youdomain.com after the user registers on the site. I have tried a lot of different things in the forum but I can't figure it out.
I placed the event as "Send Mail" after "After Insert"
This is my code:
//Send Email @9-EBE1A21F global $users; $to = $Component->yourdomain@yourdomain.com->GetText(); $subject = $Component->1->GetText(); $message = $Component->1->GetText(); $from = $Component->yourdomain@yourdomain.com->GetText(); $charset = "Windows-1252"; $transferEncoding = ""; $additional_headers = "From: $from\nReply-To: $from\nContent-Type: text/plain; charset=$charset\nContent-Transfer-Encoding: $transferEncoding"; mail ($to, $subject, $message, $additional_headers);
//End Send Email
Here is the error I get:
Parse error: parse error in C:\wamp\www\reg2\Registration_events.php on line 21
The page is registration.php
Does anyone have a solution to this? And why this is failing? I have seen other people use PHPmailer but I don't understand how to implement it.
If any of you have any insight or can help me out that would be much appreciated.
Thanks.
|
 |
 |
damian
Posts: 838
|
| Posted: 04/19/2009, 1:28 AM |
|
can you post all the lines (please use the code function above) and indicate which is line 20 and 21?
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
brink668
Posts: 11
|
| Posted: 04/19/2009, 9:56 AM |
|
19. //Send Email @9-BF2DE6E8
20. global $users;
21. $to = $Component->yourdomain@yourdomain.com->GetText();
22. $subject = $Component->This is the subject->GetText();
23. $message = $Component->This is the message->GetText();
24. $from = $Component->donotreply@donotreply.com->GetText();
25. $charset = "Windows-1252";
26. $transferEncoding = "";
27. $additional_headers = "From: $from\nReply-To: $from\nContent-Type: text/plain; charset=$charset\nContent-Transfer-Encoding: $transferEncoding";
28. mail ($to, $subject, $message, $additional_headers);
29. //End Send Email
|
 |
 |
datadoit
|
| Posted: 04/19/2009, 5:46 PM |
|
Narrow down your variables to find where it's burping at.
Rather than referencing components, hardcode addresses and your message
to at least make sure your PHP installation is configured properly.
Ex:
mail("youraddress@you.com", "Test Message", "This is a test", "From:
avalidaddress@you.com\nReply-To:avalidaddress@you.com\nContent-Type:
text/plain");
|
|
|
 |
damian
Posts: 838
|
| Posted: 04/19/2009, 9:42 PM |
|
have you configured the email server?
Did you modify the code you posted here? Can you have spaces in label names?
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
brink668
Posts: 11
|
| Posted: 04/20/2009, 10:35 AM |
|
Quote damian:
have you configured the email server?
Did you modify the code you posted here? Can you have spaces in label names?
No, I do not have an email/mail server up.. I am using Wamp, Ill have to see if I can configure a mail server with this. Thanks.
|
 |
 |
datadoit
|
| Posted: 04/20/2009, 4:51 PM |
|
If you're attempting to send mail out via a local WAMP configuration,
you're going to need to tap into an SMTP server somewhere.
ini_set("smtp", "smtp.yourmailserver.com");
mail(...);
If you don't have one, or your ISP does not allow you to relay mail
through them, then here's a local SMTP application:
http://www.softstack.com/freesmtp.html
|
|
|
 |
brink668
Posts: 11
|
| Posted: 04/27/2009, 6:11 AM |
|
Does an Exchange server work, is that SMTP?
I still am getting errors. at Line 22:
Parse error: parse error in C:\wamp\www\trees2\sample_events.php on line 22
I installed Free SMTP, I am unsure if it is working as it says looking for connection, the server is set to localhost port 25
Wamp is also configured for localhost
//Send Email @44-5B2C007F
20 global $sampleform;
21 ini_set("SMTP", "localhost");
22 $to = $Component->myemail@myeamil.com->GetText();
23 $subject = "";
$message = "";
$from = "";
$charset = "Windows-1252";
$transferEncoding = "";
$additional_headers = "From: $from\nReply-To: $from\nContent-Type: text/plain; charset=$charset\nContent-Transfer-Encoding: $transferEncoding";
mail ($to, $subject, $message, $additional_headers);
ini_restore("SMTP");
//End Send Email
|
 |
 |
brink668
Posts: 11
|
| Posted: 04/27/2009, 7:46 AM |
|
Finally Solved! With PHPMailer and GMail
|
 |
 |
mk_common
Posts: 17
|
| Posted: 07/20/2009, 7:28 AM |
|
please explain some details
how to use phpmailer and gmail
warm regards,
mk.
_________________
mk |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 07/20/2009, 11:28 AM |
|
phpmailer comes with all the documentation you need to use it.
I use that and the Swift Mailer and both are great
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
|