CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Email Problem

Print topic Send  topic

Author Message
bguthrie


Posts: 31
Posted: 03/19/2004, 2:41 PM

I've setup a test page that contains one button. I've added a "Send Mail" event to the button and supplied each of the required fields using the "=" option for test purposes. The following code was generated in CCS:


//Send Email @3-272989B1
ini_set("SMTP", "mail.apacheware.com");
$to = "bruce.guthrie@a....com";
$subject = "Test";
$message = "<b>Test!!!</b>";
$from = "bruce.guthrie@a....com";
$additional_headers = "From: $from\nReply-To: $from\nContent-Type: text/html";
mail ($to, $subject, $message, $additional_headers);
ini_restore("SMTP");
//End Send Email

The generated code looks o.k., but I'm not getting any Email sent (SMTP = localhost in php.ini).

I would appreciate any suggestions regarding this issue.
_________________
Regards,

Bruce
View profile  Send private message
sebastian

Posts: 15
Posted: 03/19/2004, 3:20 PM

Are you using a valid email address? I can see a space character before bruce.guthrie@a....com
Try using localhost as the email server.

Sebastian
View profile  Send private message
bguthrie


Posts: 31
Posted: 03/19/2004, 3:29 PM

Sebastian,

I double checked the generated code and there was no space before the Email address. I think that happened during cut/paste. I tried using "localhost" and still no go. I'm going to try bypassing my router and connecting directly to the Internet to see if anything changes.
_________________
Regards,

Bruce
View profile  Send private message
peterr


Posts: 5971
Posted: 03/19/2004, 3:43 PM

Maybe try creating a small test program to check if your mail/SMTP works at all:
<?php
mail("bruce.guthrie@a....com","Test","Test");
?>

(remove the space, as it seems that this forum adds such space to the above code)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
bguthrie


Posts: 31
Posted: 03/19/2004, 3:43 PM

Sebastian,

I tried setting things up on my hosted site and Email still did not work.
_________________
Regards,

Bruce
View profile  Send private message
bguthrie


Posts: 31
Posted: 03/19/2004, 4:06 PM

Peter,

I tried your simple program and it worked fine. CCS still does not send Email.

Thank you for your assistance.
_________________
Regards,

Bruce
View profile  Send private message
peterr


Posts: 5971
Posted: 03/19/2004, 4:15 PM

Looks like you may need to deug your code. Display/echo each of the variables to see what they contain, before or instead of sending the email.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 03/19/2004, 4:53 PM

Oops, I didn't pay enough attention to your code. The variables look clear, although displaying something will still tell you if the program ever gets to this point/event.
I also saw in the previous thread this code:
mail($receiver,$subject,$mailcontent,$headers) or die("No mail send!");

Not sure if there is a way to use the "die" statement to debug this further? (sorry, I don't use PHP too much)
Sebastian?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 03/19/2004, 4:55 PM

BTW, which of the button events did you use for this?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
bguthrie


Posts: 31
Posted: 03/19/2004, 5:55 PM

Peter,

The button event used was Server / On Click / Action Send Email. The only thing on the form is one button. I noticed in the documentation that it stated "The Send Email action is used within a Record form to send information based on the value of fields within the form." Does this mean that a button cannot be set up to send email without an associated record? I assumed (maybe incorrectly) that because the Send Email action permitted an "=" which If the value starts with '=', then the expression coming after this symbol is used in it's literal form, was acceptable.

Thank you again for your assistance.
_________________
Regards,

Bruce
View profile  Send private message
bguthrie


Posts: 31
Posted: 03/19/2004, 5:56 PM

Peter,

BTW, it doesn't look like the event is firing. Echo commands are not appearing.
_________________
Regards,

Bruce
View profile  Send private message
peterr


Posts: 5971
Posted: 03/19/2004, 6:47 PM

OK. Then now we know that this is not an email problem...

Yes, the event should fire only if the button already does something. The record form doesn't need to have an associated record in the database. For example Search forms don't.
But the button on its own doesn't perform any functionality and doesn't fire events.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
bguthrie


Posts: 31
Posted: 03/20/2004, 5:30 AM

Thank you Peter for the clarification. This will take care of it.

_________________
Regards,

Bruce
View profile  Send private message
itguy


Posts: 3
Posted: 05/11/2005, 2:16 AM

I am experiencing a similar problem, I just want to understand.

Lets say I want to use the update button of a record to send updated details to a user. This update button will not work for sending an email as it already performs another function ?

Is this correct?
View profile  Send private message
Nicole

Posts: 586
Posted: 05/11/2005, 7:12 AM

Hello,
No, you can assign Send Email action to any button of a Record/Editable grid form. In addition to Insert, Update, Delete or Cancel operation any custom code (and send mail too) can be executed.

_________________
Regards,
Nicole
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.