Problem with mail tutorial

I have followed the mail tutorial and used the web inspector to debug. Initially, I had a 500 error but have sorted that out. But still not receiving a test email. I have tried various connotations (port and such like)
and browsed the community but still unable to sort this. Any help would be appreciated.
The test page is at https://loveyurt.co.uk/formMail.php
formailer.php is as follows…

<?php
require('../../../dmxConnectLib/dmxConnect.php');


$app = new \lib\App();

$app->define(<<<'JSON'
{
  "meta": {
    "options": {
      "linkedFile": "/formMail.php",
      "linkedForm": "form1"
    },
    "$_POST": [
      {
        "type": "text",
        "fieldName": "name",
        "name": "name"
      },
      {
        "type": "text",
        "fieldName": "email",
        "name": "email"
      },
      {
        "type": "text",
        "fieldName": "text",
        "name": "text"
      }
    ]
  },
  "exec": {
    "steps": [
      {
        "name": "mail1",
        "module": "mail",
        "action": "setup",
        "options": {
          "host": "81.19.183.240",
          "username": "info",
          "password": "********"
        }
      },
      {
        "name": "",
        "module": "mail",
        "action": "send",
        "options": {
          "instance": "mail1",
          "subject": "test",
          "fromName": "{{$_POST.name}}",
          "fromEmail": "{{$_POST.email}}",
          "toName": "Andre",
          "toEmail": "andreletissier@me.com",
          "body": "{{$_POST.text}}"
        }
      }
    ]
  }
}
JSON
);
?>

Thanks in advance

Hi Andre,

Start the troubleshooting by turning on the output of your sendmail action to see what it reports. You could also use static email addresses for to and from until you know the mail sending is working properly.

Good idea thanks I will try that

I turned on the output but no additional errors. I tested sendMail with static email addresses and it works fine. So still stuck…

The problem seems to be in the PHP file. Please turn the debug mode on and re-upload the page.

Let us know when done so that we can retest.

Hello,
We’ve just updated the mailer component used in Wappler for PHP to the more modern PHPMailer.
Please re-save your server action and try again, to see if your issue has been fixed.

Any updates on the mailer…? Email scripts are not sending out email. They all were working great prior to the update 3.5.0

Please check for errors, as explained here:

Apologies for slow reply I was checking the server to see if there was another issue, but all seems ok. Still no joy on getting this to work. Debugging is turned on. Nothing showing.

I tell a lie

{
“code”: 0,
“file”: “/var/www/vhosts/loveyurt.co.uk/httpdocs/dmxConnectLib/PHPMailer/PHPMailer/PHPMailer.php”,
“line”: 1256,
“message”: "Invalid address: (From): ",
“trace”: “#0 /var/www/vhosts/loveyurt.co.uk/httpdocs/dmxConnectLib/modules/mail.php(79): PHPMailer\PHPMailer\PHPMailer->setFrom()\n#1 /var/www/vhosts/loveyurt.co.uk/httpdocs/dmxConnectLib/lib/App.php(199): modules\mail->send()\n#2 /var/www/vhosts/loveyurt.co.uk/httpdocs/dmxConnectLib/lib/App.php(163): lib\App->execSteps()\n#3 /var/www/vhosts/loveyurt.co.uk/httpdocs/dmxConnectLib/lib/App.php(133): lib\App->execSteps()\n#4 /var/www/vhosts/loveyurt.co.uk/httpdocs/dmxConnectLib/lib/App.php(116): lib\App->exec()\n#5 /var/www/vhosts/loveyurt.co.uk/httpdocs/dmxConnectLib/lib/App.php(94): lib\App->exec()\n#6 /var/www/vhosts/loveyurt.co.uk/httpdocs/dmxConnect/api/mail/formmailer.php(8): lib\App->define()\n#7 {main}”
}

So what have you entered in the from address option?
It appears there is an invalid address there.

Yes of course

I am not sure I understand your answer. I asked:

I am actually asking what expression are you using in the send mail step in Server Action?
It seems the expression is returning either an invalid value or no value.

Ah ok. I am using $_POST.email

It seems this returns no value. Can you please remove all your post vars and import the form inputs again?

Theodor done but the same result “message”: "Invalid address: (From): "

Can you please do the following:

  1. Disable send mail step.
  2. Add set value step and assign the $_POST.email as its value
  3. Enable the output option for your setvalue.

Submit your form and check the results in the console - do you see a value returned by the setvalue step?

Oh, i just saw the link in your first post.
You have an issue on your form. Why are you using dmx-on:submit="form1.reset()"? It’s a wrong behavior, you don’t want to reset your form on submit as the form inputs will be cleared when you click the submit button, so that’s why no value is submitted to the mailer …

If you want to reset your form, after the mail has been sent use the server connect > success and then call the reset, not on submit!

1 Like