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

Hhm, sad. I send you a PM.

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

Thanks horst, my form uses POST method. I will see if I can apply some of what you wrote to my code.

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

Hi there! 

Struggling to get this to work with Office365 and TLS, has anyone succeeded with this? I've tried different combinations, but all I get is "ERROR: SMTP settings did not work." and "could not start TLS connection encryption protocol". Anything I could try? Thanks!

Share this post


Link to post
Share on other sites

Hi @nikoka

I was struggling with an other Microsoft service yesterday and make me think that your issue is with your entered information.

Try :

  • SMTP port: 587
  • SMTP user: yourmail@provider.com
  • Check START-SSL
  • Uncheck use SSL
  • Like 1

Share this post


Link to post
Share on other sites

Thanks @flydev,

Tried with those, in addition with the SMTP server: smtp.office365.com, but no luck there.

Share this post


Link to post
Share on other sites

I just tested with an Office365 account with these settings, it works well. WireMailSMTP 0.3.0 here.

Look like its your credentials that are incorrect ?  Double check ;)

 

smtp.thumb.png.19fcd8a84f8e76a1e96e78304f38dbf6.png

Edited by flydev
config screen + WMS version
  • Like 2

Share this post


Link to post
Share on other sites

Emailaddresses in CC array keep being encoded

I have a small module with a function that sends emails to me(Admin) and users who act as moderators.
What I want to do is basically this:(from first post here)

$options = array(
    'sendSingle' => true,
    'cc' => array('person1@example.com', 'person2@example.com', 'person3@example.com')
    );
$numSent = wireMail($to, '', $subject, $textBody, $options); 

But I want to CC to users of a certain role, and retrieve the users like that:

$address_rev = wire('users')->find("roles=revisor");

Now I have to build the array for the $options:

foreach($address_rev as $one){ $emailcc .= "'" . $one->email . "',"; }
$emailcc = rtrim($emailcc, ',');// remove the last comma

$options = array(
    'sendSingle' => true,
    'cc' => array("$emailcc")
    );

But sending fails with the quotes being encoded by PWs sanitizer(I assume)
Invalid email address (&#039;person1@example.com&#039;, &#039;person2@example.com&#039;) (in path_to....\wire\core\WireMail.php line 105)
Why?
It doesn't happen when I hardcode the array like in the example, and when I echo my array it looks just fine.

How do I build the array to populate the cc array? Or what am I doing wrong?

PW 3.0.84 WireMailSMTP 0.2.3

Share this post


Link to post
Share on other sites
24 minutes ago, Klenkes said:

But sending fails with the quotes being encoded by PWs sanitizer(I assume)
Invalid email address (&#039;person1@example.com&#039;, &#039;person2@example.com&#039;) (in path_to....\wire\core\WireMail.php line 105)
Why?

Maybe you better should collect an array, and leave it as is?

$address_rev = wire('users')->find("roles=revisor");
$emailcc = array();
foreach($address_rev as $one){ 
	$emailcc[] = one->email
}
$options = array(
    'sendSingle' => true,
    'cc' => $emailcc
);

 

  • 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 Mike Rockett
      As I mentioned in this issue, I've create a new textformatter for ParsedownExtraPlugin, which adds some oomph to your markdown.
      Repo: Parsedown Extra Plugin
      Unlike the built-in textformatter for Parsedown and Parsedown Extra, this should be used when you want to use Extra with additional configuration/customisation.
      Some examples:
      ### Test {.heading} - A [external link](https://google.com/){.google} with `google` as a class that opens in a new tab if the config property is set. - [Another link](/page){target=_blank} that opens in a new tab even though it isn't external. ```html .html <p>Test</p> ``` There's some config options available to you, such as setting attributes on all/external images and links, setting table and table-cell alignment classes, adjusting footnote classes and IDs, adding <code> attributes to their parent <pre> elements, and changing the <code> class if your syntax highlighter does not use language-*.
      I was thinking about adding the ability to make links open in a new tab by appending a plus to the link syntax, but only external links should be opening in a new tab anyway. Further, this would add extra, unnecessary processing time.
      Please let me know if you bump into any problems. ☺️
    • By Mike Rockett
      TextformatterTypographer (0.4.0 Beta)
      A ProcessWire wrapper for the awesome PHP Typography class, originally authored by KINGdesk LLC and enhanced by Peter Putzer in wp-Typography. Like Smartypants, it supercharges text fields with enhanced typography and typesetting, such as smart quotations, hyphenation in 59 languages, ellipses, copyright-, trade-, and service-marks, math symbols, and more.
      Learn more on my blog
      It's based on the PHP-Typography library found over at wp-Typography, which is more frequently updated and feature rich that its original by KINGdesk LLC.
      The module itself is fully configurable. I haven't done extensive testing, but there is nothing complex about this, and so I only envisage a typographical bug here and there, if any.
      Please do test it out and let me know what you think.
      Also note that I have indicated support for PW 2.8, but I haven't tested there as yet. This was built on PW 3.0.42/62.
    • By Mike Rockett
      Jumplinks for ProcessWire
      Release: 1.5.50
      Jumplinks is an enhanced version of the original ProcessRedirects by Antti Peisa.
      The Process module manages your permanent and temporary redirects (we'll call these "jumplinks" from now on, unless in reference to redirects from another module), useful for when you're migrating over to ProcessWire from another system/platform. Each jumplink supports wildcards, shortening the time needed to create them.
      Unlike similar modules for other platforms, wildcards in Jumplinks are much easier to work with, as Regular Expressions are not fully exposed. Instead, parameters wrapped in curly braces are used - these are described in the documentation.
      Under Development: 2.0, to be powered by FastRoute
      As of version 1.5.0, Jumplinks requires at least ProcessWire 2.6.1 to run.
      View on GitLab
      Download via the Modules Directory
      Read the docs
      Features
      The most prominent features include:
      Basic jumplinks (from one fixed route to another) Parameter-based wildcards with "Smart" equivalents Mapping Collections (for converting ID-based routes to their named-equivalents without the need to create multiple jumplinks) Destination Selectors (for finding and redirecting to pages containing legacy location information) Timed Activation (activate and/or deactivate jumplinks at specific times) 404-Monitor (for creating jumplinks based on 404 hits) Additionally, the following features may come in handy:
      Stale jumplink management Legacy domain support for slow migrations An importer (from CSV or ProcessRedirects) Feedback & Feature Requests
      I’d love to know what you think of this module. Please provide some feedback on the module as a whole, or even regarding smaller things that make it whole. Also, please feel free to submit feature requests and their use-cases.
      Note: Features requested so far have been added to the to-do list, and will be added to 2.0, and not the current dev/master branches.
      Open Source

      Jumplinks is an open-source project, and is free to use. In fact, Jumplinks will always be open-source, and will always remain free to use. Forever. If you would like to support the development of Jumplinks, please consider making a small donation via PayPal.
      Enjoy! 
    • By bernhard
      Some of you might have followed the development of this module here: https://processwire.com/talk/topic/15524-previewdiscussion-rockdatatables/ . It is the successor of "RockDataTables" and requires RockFinder to get the data for the grid easily and efficiently. It uses the open source part of agGrid for grid rendering.
       
      WHY?
      ProcessWire is awesome for creating all kinds of custom backend applications, but where it is not so awesome in my opinion is when it comes to listing this data. Of course we have the built in page lister and we have ListerPro, but none of that solutions is capable of properly displaying large amounts of data, for example lists of revenues, aggregations, quick and easy sorts by the user, instant filter and those kind of features. RockGrid to the rescue 😉 
       
      Features/Highlights:
      100k+ rows Instant (client side) filter, search, sort (different sort based on data type, eg "lower/greater than" for numbers, "contains" for strings) extendable via plugins (available plugins at the moment: fullscreen, csv export, reload, batch-processing of data, column sum/statistics, row selection) all the agGrid features (cell renderers, cell styling, pagination, column grouping etc) vanilla javascript, backend and frontend support (though not all plugins are working on the frontend yet and I don't plan to support it as long as I don't need it myself)  
      Limitations:
      While there is an option to retrieve data via AJAX the actual processing of the grid (displaying, filtering, sorting) is done on the client side, meaning that you can get into troubles when handling really large datasets of several thousands of rows. agGrid should be one of the most performant grid options in the world (see the official example page with a 100k row example) and does a lot to prevent problems (such as virtual row rendering), but you should always have this limitation in mind as this is a major difference to the available lister options that do not have this limitation.
      Currently it only supports AdminThemeUikit and I don't plan to support any other admin theme.
       
      Download: https://gitlab.com/baumrock/FieldtypeRockGrid
      Installation: https://gitlab.com/baumrock/RockGrid/wikis/Installation
      Quikckstart: https://gitlab.com/baumrock/RockGrid/wikis/quickstart
      Further instructions: https://gitlab.com/baumrock/RockGrid/wikis/quickstart#further-instructions
      German Translation File: site--modules--fieldtyperockgrid--fieldtyperockgrid-module-php.json
      Changelog: https://gitlab.com/baumrock/FieldtypeRockGrid/raw/master/changelog.md
       
      Module status: alpha, License: MIT
      Note that every installation and uninstallation sends an anonymous google analytics event to my google analytics account. If you don't want that feel free to remove the appropriate lines of code before installation/uninstallation.
       
      Contribute:
      You can contribute to the development of this and other modules or just say thank you by
      testing, reporting issues and making PRs at gitlab liking this post buying me a drink: paypal.me/baumrock/5 liking my facebook page: facebook.com/baumrock hiring me for pw work: baumrock.com  
      Support: Please note that this module might not be as easy and plug&play as many other modules. It needs a good understanding of agGrid (and JavaScript in general) and it likely needs some looks into the code to get all the options. Please understand that I can not provide free support for every request here in the forum. I try to answer all questions that might also help others or that might improve the module but for individual requests I offer paid support for 60€ per hour (excl vat).
       
      Use Cases / Examples:
      Colored grid cells, Icons, Links etc. The Grid also has a "batcher" feature built in that helps communicating with the server via AJAX and managing resource intensive tasks in batches:

      Filters, PW panel links and instant reload on panel close:

      You can combine the grid with a chart library like I did with the (outdated) RockDataTables module:

    • By thomasaull
      Some time ago I created a site profile for creation of a REST API with ProcessWire. Since I kept struggeling with updating stuff between different projects which use this, I decided to convert it into a module. It is now ready for testing: https://github.com/thomasaull/RestApi
      Additionally I added a few small features:
      automatic creation of JWT Secret at module install routes can be flagged as auth: false, which makes them publicly accessible even though JWT Auth is activated in module settings To check things out, download and install the module and check the folder /site/api for examples.
      If you find any bugs or can think of improvements, please let me know!