![]() |
Sergey Kornilov admin 10/11/2019 |
My suggestion is to start with a single hardcoded email address. If you will be getting exactly the same error message that would mean something is wrong with mail server configuration. There is a bunch of possible reasons for this kind of error listed here: https://www.werockyourweb.com/503-valid-rcpt-command-must-precede-data/ |
B
|
bcritchley author 10/12/2019 |
My suggestion is to start with a single hardcoded email address. If you will be getting exactly the same error message that would mean something is wrong with mail server configuration. There is a bunch of possible reasons for this kind of error listed here: https://www.werockyourweb.com/503-valid-rcpt-command-must-precede-data/ You will have to double-check all SMTP settings.
|
![]() |
Sergey Kornilov admin 10/12/2019 |
This means you do not have a correct email or emails in $email variable. Instead of sending the email print the $email variable on the page to see what is in there. |
B
|
bcritchley author 10/23/2019 |
My table has a field called Custodial_Email that contains a valid email address. I am trying to have a custom button at the bottom of the edit page that would allow my staff to send some information on the current record to the email address contained within the Custodial_Email field of the same record. I found the section of the manual that deals with this "Send an email to selected users" and copied the code in the first setup and changed to the fields in red accordingly, but when I build and run it is giving me an error. Error I receive on Edit Page after build and trying button Error happened: File: C:\inetpub\wwwroot\Projects\Requests\output\include\phpfunctions.php Line: 277 Description: mail(): SMTP server response: 503 5.5.2 Need rcpt command Server Tab Code of Custom Button // Place event code here. // Use "Add Action" button to add code snippets. // Put your code here. $emails = array(); while( $data = $button->getNextSelectedRecord() ) { if( $data["Custodial_Email"] ) $emails[] = $data["Custodial_Email"]; } // send the email $email = implode(", ", $emails); $subject = "Sample subject"; $body = "Your email text here"; $arr = runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $body)); $result["txt"] = "Emails were sent."; // if error happened print a message on the web page if( !$arr["mailed"] ) { $errmsg = "Error happened: "; $errmsg.= "File: " . $arr["errors"][0]["file"] . " "; $errmsg.= "Line: " . $arr["errors"][0]["line"] . " "; $errmsg.= "Description: " . $arr["errors"][0]["description"] . " "; $result["txt"] = $errmsg; } Client After Tab of button // Put your code here. var message = result["txt"]; ctrl.setMessage(message);
|
B
|
bcritchley author 10/25/2019 |
I could not figure out how to get the button to work as I wanted so I ended up changing the on edit event to include the following so that when the field value is changed, that triggers the email. |