horst

WireMailSmtp

Recommended Posts

It could be. You'd normally get an error/warning saying function is already defined, though.

Share this post


Link to post
Share on other sites

I guess the different case may have allowed it to sneak through - I can confirm I'm not seeing the issue now that I've renamed my function.

I'll follow up if the issue remains resolved.

Thanks for your help!

Share this post


Link to post
Share on other sites

I upgraded to version 0.2.6 today and cannot make use of the module.  It seems to not save the SMTP Password anymore.  I can send additional SMTP Configuration information via PM, if necessary.  Once I reverted back to version 0.2.5 everything worked as before.

Share this post


Link to post
Share on other sites
3 minutes ago, cstevensjr said:

I upgraded to version 0.2.6 today and cannot make use of the module.  It seems to not save the SMTP Password anymore.  I can send additional SMTP Configuration information via PM, if necessary.  Once I reverted back to version 0.2.5 everything worked as before.

Shit, my bad, sent another PR

https://github.com/horst-n/WireMailSmtp/pull/10

  • Like 1

Share this post


Link to post
Share on other sites
Just now, abdus said:

Shit, my bad, sent another PR


smtp_password

@abdus please update the version too in your PR. Thanks.

  • Like 1

Share this post


Link to post
Share on other sites
2 minutes ago, horst said:

please update the version too in your PR. Thanks.

Done.

image.png.587d5632ff34a4966836d89694253ef1.png

  • Like 2

Share this post


Link to post
Share on other sites

Done too!

Its updated to 0.2.7. All in all we only used 7 minutes to react on Charles issue report! Cool! :)

 

  • Like 6

Share this post


Link to post
Share on other sites
2 hours ago, horst said:

Done too!

Its updated to 0.2.7. All in all we only used 7 minutes to react on Charles issue report! Cool! :)

 

Thanks all (@abdus and  @horst) for the quick response.  I'd be lost without this module, I use it on every site.  Also thanks to @ryan for having the feature of saving the previous version of each module when using his Upgrade module. 

  • Like 2

Share this post


Link to post
Share on other sites

I try to connect to our SMTP server, which has no authentification, default port 25, but when I test the Settings I get the following error

  •  server does not require authentication

Share this post


Link to post
Share on other sites

Hi @dreerr, sorry, this is a known limitation: The test is only functional for connections with authentication.

But regardless of the failing test in this case, it should be possible to send mails without authentication. Hvae you tried it? Does it work?

Share this post


Link to post
Share on other sites

In the log files I get the error when trying to send a mail:

 
Error in hnsmtp::send : cannot connect to smtp-server!

Share this post


Link to post
Share on other sites

Hi, I am trying to implement wireMail attachment method into my form. I started a thread in the 'getting started' area but maybe this is the better place for it since it is specifically about wireMail. Basically I just want someone to be able to add an image to a form, then send it in an email. 

The field in my form is:

    <input type="file" name="user_image" />

I've been looking at this thread and trying to cobble something together. I am very new to php. I know this is wrong but this is as far as I can make out what I'm supposed to do:

$user_image = 'user_image->$filename';
$mail = wireMail();
$mail->attachment($filename);
$mail->send(); 

Any links to any other forum threads, or php info, would be greatly appreciated. I've been trying to figure this out for two days. The documentation at

 https://processwire.com/api/ref/wire-mail/attachment/

is nice and simple but too simple for where my understanding is at. Thanks!

Share this post


Link to post
Share on other sites
20 hours ago, ryanC said:

$user_image = 'user_image->$filename';
$mail = wireMail();
$mail->attachment($filename);
$mail->send(); 

 

There seems to be a little quirks with the different parts.

First, a user will submit a from with a filefield. You need to check if there was sent a file, and if yes, get the file from this field. Do you use the GET or POST method with your form submit? Please refer to the PW vars $input->post->{...FIELDNAME...} or $input->get->{...FIELDNAME...}.

Once you have your file / filename, you can attach it to the wiremail object.

To check your process step by step, you may write some little prooflines into your script, like:

$filename = $input->post->.... ; // get the file / filename from your form submission

// now debug / check, if all went good for this step
var_dump(is_file($filename));  // also possible PHP functions: is_readable($filename)
die('DEBUG BREAK AT: ' . __FILE__ . ':' . __LINE__);

If this is true, you can delete this debug lines from your script and sent the email with attachment to a testaccount first. :)

  • Like 1

Share this post


Link to post
Share on other sites

Hi there,

after installing the Wire Mail Module, i get a Fatal Error message when opening the settings page:

Recoverable Fatal Error: Argument 1 passed to InputfieldWrapper::add() must be an instance of Inputfield, array given, called in /var/www/vhosts/mydomain.de/httpsdocs/site/modules/WireMailSmtp/WireMailSmtpConfig.php on line 60 and defined (line 162 of /var/www/vhosts/mydomain.de/httpsdocs/wire/core/InputfieldWrapper.php) This error message was shown because you are logged in as a Superuser. Error has been logged.


I'm using ProcessWire 2.5.3. Can anyobody help me?

Thanks!

Recoverable Fatal Error: Argument 1 passed to InputfieldWrapper::add() must be an instance of Inputfield, array given, called in /var/www/vhosts/mydomain.de/httpsdocs/site/modules/WireMailSmtp/WireMailSmtpConfig.php on line 60 and defined (line 162 of /var/www/vhosts/mydomain.de/httpsdocs/wire/core/InputfieldWrapper.php)
This error message was shown because you are logged in as a Superuser. Error has been logged.

Share this post


Link to post
Share on other sites

Hi @Mailte,

thats bad. There were a pull request added some time ago, that should make the config page a bit more shiny.

Unfortunately, now I recognized that it broke the backwards compatibility. I have tested it with PW 2.5.0, where I get exactly the error you described.
With PW 2.5.11+ it runs as expected, without errors!

So, you may have 2 options now:

my prioritized option is to get the WireMail SMTP version 0.2.5, they are known to work with PW 2.4.1 - 2.5.10 too,
(
https://github.com/horst-n/WireMailSmtp/tree/532dd94752597a4b2b9f3a2c02ef48b21db77f84)

or upgrade your pw version to at least 2.5.11 or 2.6.0.
But when upgrading your PW version, please first try it in a copy, not on a live site. With and after PW +2.5.11 there were some changes in images variation naming scheme, that may lead to issues like massive images recreations and a lot of orphaned variation files!

Or, you have to wait until I get time to rearange the last commits to also work with prior PW versions than 2.5.11, as it was before.

 

I updated the code of the config screen to make it backwards compatible again.

Please download / install the latest module version 0.3.0 to use it with PW 2.5.3

:)

https://github.com/horst-n/WireMailSmtp  or  http://modules.processwire.com/modules/wire-mail-smtp/

 

Edited by horst
added note to the updated module version
  • Like 2

Share this post


Link to post
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 Robin S
      An experimental module for adding images to a field via pasting one or more URLs.
      Add Image URLs
      Allows images to be added to an images field by pasting URLs.

      Usage
      Install the Add Image URLs module.
      A "Paste URLs" button will be added to all image fields. Use the button to show a textarea where image URLs may be pasted, one per line. Images are added when the page is saved.
       
      https://github.com/Toutouwai/AddImageUrls
    • By netcarver
      This module provides a very simple interface to a set of named counters. You simply call a single function, next('name'), to pull the next value out of a counter - or to set it up if it does not yet exist. Next() takes a few extra parameters to allow you to increment by values other than 1 or to start at a certain number.
      This provides some similar functionality to the built-in page naming feature of PW, and to this module recently posted by Stikki but I think it offers a little more flexibility than either. Having said that, I do like the simplicity of Stikki's new auto-increment module.
      Module Availability
      Here is my module on Github.
      Here it is in the module repository.
      Example Usage
      Here's how this module can be used to title and name a new page by adding a couple of simple hooks to site/ready.php. This example applies to new pages using a template called 'invoice' that can be quick-added to the page tree. In order to get the following to work, you must edit the template that will be the parent of the 'invoice' template and setup the template for children to "invoice" and set the "Name Format for Children" field to something other than the default blank value (I use  title  as my value.)
      <?php /** * Function to recognise our special template. */ function isInvoiceTemplate($template) { return ($template == 'invoice'); } /** * Pre-load the page title for invoice pages with a unique value * which includes a counter component. */ $pages->addHookBefore("Pages::setupNew", function($event) { $page = $event->arguments(0); $is_invoice = isInvoiceTemplate($page->template); $no_inv_num = $page->title == ''; if ($is_invoice && $no_inv_num) { $counter_name = 'WR-' . date('Y'); $number = $this->modules->get('DatabaseCounters')->next($counter_name, 10, 5000); $page->title = $counter_name . '-' . sprintf("%06u", $number); } }); /** * Prevent ProcessPageEdit from forcing an edit of the name if we got here * through a quickAdd from ProcessPageAdd. We can do this because we * preset the title field in the Pages::setupNew hook. */ $pages->addHookAfter("ProcessPageEdit::loadPage", function($event) { $page = $event->return; $is_invoice = isInvoiceTemplate($page->template); $is_temp = $page->hasStatus(Page::statusTemp); if ($is_invoice && $is_temp) { $page->removeStatus(Page::statusTemp); $event->return = $page; } }); Note, the above code + module is one direct solution to the problem posted here by RyanJ.


      Version History
      1.0.0 The initial release.
    • By flydev
      PulsewayPush
      Send "push" from ProcessWire to Pulseway.
       
      Description
      PulsewayPush simply send a push to a Pulseway instance. If you are using this module, you probably installed Pulseway on your mobile device: you will receive notification on your mobile.
      To get more information about Pulseway, please visit their website.
      Note
      They have a free plan which include 10 notifications (push) each day.
       
      Usage
      Install the PulsewayPush module.
      Then call the module where you like in your module/template code :
      <?php $modules->get("PulsewayPush")->push("The title", "The notification message.", "elevated"); ?>  
      Hookable function
      ___push() ___notify() (the two function do the same thing)
       
      Download
      Github:  https://github.com/flydev-fr/PulsewayPush Modules Directory: https://modules.processwire.com/modules/pulseway-push/  
      Examples of use case
      I needed for our work a system which send notification to mobile device in case of a client request immediate support. Pulseway was choosen because it is already used to monitor our infrastructure.
      An idea, you could use the free plan to monitor your blog or website regarding the number of failed logins attempts (hooking Login/Register?), the automated tool then block the attacker's IP with firewall rules and send you a notification.
       

       
      - - -
      2017-11-22: added the module to the modules directory
       
    • By cosmicsafari
      Hi all,
      Just wondering if its possible to just add some basic output to my modules config page.
      I was wanting to output a bulleted list of some information which I will be pulling from a third party.
      Retrieving the data is fine i'm just not sure how to output it to the config page?
      From what I can see in the link below, it only seems like you can append form items to the page.
      https://processwire.com/blog/posts/new-module-configuration-options/
    • By netcarver
      A very simple textformatter that was inspired by Diogo's RemoveHeight textformatter.
      This one strips the height from any images and either adds a custom class or adds a max-width:100% as an embedded style.
      Github: https://github.com/netcarver/TextformatterFluidImages
      PW Repo: here.