Jump to content

[ Solved ] WireMail::mailHTML does not exist


Recommended Posts

Hi everyone ...

Generally, this is about the new mailHTML() function that does not work correctly on processwire 3.0.110


I do not know if I'm making a mistake trying to send an e-mail or if it's a bug in the core
This is my code:

// $m = $mail->new(); // option A
// $m = new WireMail(); // option B
   $m = wireMail(); // option C
   $m->mailHTML('alex@gmail.com', 'Hello', '<html><body><h1>Message Body</h1></body></html>');


Details from Tracy Debugger

ProcessWire: 3.0.110
PHP: 7.2.8
Webserver: Apache/2.4.34 (Unix)
MySQL: 10.1.34-MariaDB

allow_url_fopen: 1
max_execution_time: 120 (changeable)
max_input_nesting_level: 64
max_input_time: 60
max_input_vars: 1000
memory_limit: 256M
post_max_size: 8M
upload_max_filesize: 20M
mod_rewrite: 1
mod_security: *confirmed off
GD: 2.2.5
GIF: 1
JPG: 1
PNG: 1
EXIF Support:
FreeType: 1
Imagick Extension:

TracyDebugger: 4.11.13

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By Mithlesh
      Hi there,
      My form is not getting submitted, it is showing:
      Unable to verify successful email delivery of this form submission.
      Attaching for your reference as well: 

      In the Backend, it is showing Connection timed out with smtp.gmail.com
      Pl guide me how to resolve that
    • By abdulqayyum
      hello processwire community,
      i am using LoginRegister module for front-end user registration. i am facing an issue verification email not receiving while WireMailSmtp is working perfectly and user receives message
      "Thank you, a confirmation code has been emailed to you. When you receive the email, click the link it contains, or paste the confirmation code below."
      received this message in front-end but does not receive any email relevant it.
      please help me in this case how i can solve it.
      Please check screen shots for SMTP test and message which receives user.
      Thanks AbdulQayyum,

      First screenshot SMTP test message, second when user receives message after clicking register button.
    • By chrizz
      Usually I write modules just for me and my projects because they are more or less individual. Mail Debugger is the first module which might be interested for someone else as well. 
      Basically it covers two use cases: 
      1) Log outgoing emails
      2) In debug mode mails are send to a specified email address instead of the original recipient(s)
      I checked the compatibility for PW 3+ because unfortunately I don't have any other version for testing currently. Feel free to drop me a comment if the module works also for older PW versions. 
    • By modifiedcontent
      How should messages for Wire or $mail->send() be formatted? There is some information here; you can send text and html versions, but there are no examples how to format those.
      /n or /r/n etc. is ignored for the text version. What syntax should be used to get line breaks in the email?
      For the html version, it would be nice if you could pull that from a field. For most emails you would need to be able to insert the recipient's name and other data. PHP variables don't work in field content.
      Are there other ways to achieve this; replace a tag in the field body with data from php script in the template? Maybe with Hanna Code? Or is that what RuntimeMarkupField is for?
    • By psy
      I wanted to view the contents of a JSON post in a web hook from an external application.  In this instance the source application was Stripe posting event info at irregular intervals to a PW page URL. The process had to be unobtrusive. 
      Solution was to send an email to myself. The web hook page template contained:
      // create a PW mail object using whatever method works for you $mail = wire()->modules('WireMailSmtp');   // Retrieve the request's body and parse it as JSON $stripe_input = @file_get_contents("php://input"); $event_json = json_decode($stripe_input); try {          $body = "<pre>" . var_export($event_json, true) . "</pre>";         $mail->to('my@emailaddress.com');         $mail->from('from@emailaddress.com');         $mail->subject('test event_json');         $mail->bodyHTML($body);         $mail->send(); } catch (\Exception $e) {      $error = "Email not sent: " . $e->getMessage();      $mail->log($error);    }   Resulting email body contains nicely formatted code, eg:
      stdClass::__set_state(array(    'id' => 'evt_XXXXXXXXXXXXXXXX',    'object' => 'event',    'api_version' => '2016-07-06',    'created' => 1476900798,    'data' =>    stdClass::__set_state(array(      'object' =>      stdClass::__set_state(array(        'id' => 'sub_XXXXXXXXXXXXXXXX',        'object' => 'subscription',        'application_fee_percent' => NULL,        'cancel_at_period_end' => false,        'canceled_at' => NULL,        'created' => 1476900796,        'current_period_end' => 1508436796,        'current_period_start' => 1476900796,        'customer' => 'cus_XXXXXXXXXXXXXXXX',        'discount' => NULL,        'ended_at' => NULL,        'livemode' => true,        'metadata' =>        stdClass::__set_state(array(       )),        'plan' =>        stdClass::__set_state(array(          'id' => 'annual',          'object' => 'plan',          'amount' => 8000,          'created' => 1474521586,          'currency' => 'usd',          'interval' => 'year',          'interval_count' => 1,          'livemode' => true,          'metadata' =>          stdClass::__set_state(array(         )),          'name' => 'Annual',          'statement_descriptor' => NULL,          'trial_period_days' => NULL,       )),        'quantity' => 1,        'start' => 1476900796,        'status' => 'active',        'tax_percent' => NULL,        'trial_end' => NULL,        'trial_start' => NULL,     )),   )),    'livemode' => true,    'pending_webhooks' => 1,    'request' => 'req_XXXXXXXXXXXXXXXX',    'type' => 'customer.subscription.created', ))
  • Create New...