Jump to content
Stefanowitsch

WireMail error: Undefined index: replyToName

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. 

 

Share this post


Link to post
Share on other sites

@Stefanowitsch

Please post a code snippet and your ProcessWire version, otherwise it is difficult to reproduce the error.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Moderator note: this thread was moved to "General Support". Modules section is intended for dedicated third party module support threads only, and this question is about a built-in core feature.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...