Jump to content

WireMail error: Undefined index: replyToName


Stefanowitsch
 Share

Recommended Posts

Hello!

I am testing some forms and get an error when using the replyToName() method:

Notice: Undefined index: replyToName in /XXX/XXX/Sites/processwire-new/wire/core/WireMail.php on line 319

---

I took a look at the documentation: https://processwire.com/api/ref/wire-mail/reply-to/

From the documentation I get the information that I CAN use a second argument - the "name". But it is optional. 

In my form code I don't do that. I just use the sender e-mail address as a single argument. But why is this error occuring?

When I use a second argument - any string - there are no errors at all. 

 

Link to comment
Share on other sites

I am using PW Version 3.0.98 together with WireMailSMTP 0.4.2.

My form code:

$mail->to($toEmail);
$mail->from('mailer@site.de');
$mail->replyTo($fromEmail);
$mail->subject('Neue Nachricht über das Kontaktformular');
$mail->bodyHTML ($message);
$mail->logActivity("mail sent");
$numSent = $mail->send();

The variable $fromEmail contains the address that was given in the form.

I get this error:
Notice: Undefined index: replyToName in /XXX/XXX/Sites/processwire-new/wire/core/WireMail.php on line 319

The mail is sent successfully though.

This works fine:

 $mail->replyTo($fromEmail, 'foo');

But again, the second argument is optional. I don't want to use it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...