Sunday Skill Booster: How to setup SMTP mail in Blocs!

Hey there, future email wizards! :man_mage::e-mail: Get ready for a FREE magical adventure as we dive into the world of setting up SMTP Mail in Blocs. Imagine being able to send electronic letters to friends, family, or even your favourite superhero, without using an owl, a carrier pigeon or the much-hated built-in PHP Mail! :owl::mailbox_with_mail: :rage:

In this tutorial, we’ll transform you into an SMTP email-sending superstar, no matter if you’re 10 years old or 100! We’ll be breaking down the mystical SMTP Mail setup in Blocs into bite-sized pieces, so even your pet goldfish could understand it. :tropical_fish::sparkles: :rofl:

So, buckle up, grab your wand (or mouse), and join us on this enchanting journey to become the ultimate SMTP wizard with Blocs! Abracadabra! :magic_wand:

Allez on y va: (That’s French in case… :grin: :fr: :baguette_bread: :croissant:)
1. Download PHPMailer from here:

2. Download the send_form_smtp.php here:
send_form_smtp.php_V2.zip (1.2 KB)

3. Unzip both files
4. Rename the “src” folder to PHPMailer (don’t mess around with the capitals! :grin:) and delete the rest.

Small Potato Ltd 2023-04-16 at 08.19.10

5. Here we go with the tricky part. You’ll need to add your email host credentials to the send_form_smtp.php file. Use Apple’s text editor or a code editor to modify.

  1. Add your account details
  2. Add your email address
  3. Add a link to your website Thank-You page

6. Upload the .PHP file and the folder to the root of your website.

7. In Blocs create a form and set Type to ‘custom’, Action to your .PHP file and Method to ‘Post’

8. Save export and upload your project.

If all is done correctly your form will use SMTP instead of PHP.
Small Potato Ltd 2023-04-16 at 08.12.57

Congratulations, email wizards! :man_mage::e-mail: You’ve made it to the end of our magical and FREE SMTP Mail setup adventure in Blocs. You’ve conquered each challenge, tamed the mystical creatures of the form realm, and unlocked the power to receive electronic SMTP forms far and wide! :earth_africa::sparkles:

As you spread your wings (or mouse) and venture forth into the world of forms, remember the enchanting lessons you’ve learned here today. Don’t forget to share your newfound powers with friends, family, and maybe even a friendly dragon or two! :dragon::love_letter: :grin:

So, go forth, brave wizards, and sprinkle your email magic across the digital landscape! And if you ever need a refresher on your SMTP Mail Form potion recipe, just hop back onto your trusty broomstick and return to this tutorial. Until next time, keep spell-casting and happy form creating! Hocus Pocus! :magic_wand::tada:

Note to self: I’ve deserved a :coffee: under the :coconut: :palm_tree: :sunny: :parasol_on_ground: :dark_sunglasses:

After coffee thoughts. :coffee::sleeping:
You could even make it easier by wrapping the PHPMailer folder and the .PHP file into a folder and attaching this to your Blocs project. You will just need to set the path in the sent_form_smtp.php file and the Action setting in your project correctly.

UPDATE:
I’ve re-uploaded the .PHP file as it pointed to the wrong directory.

16 Likes

This turned out to be very good and useful @Jerry :ok_hand: :slightly_smiling_face:

1 Like

Jerry, very good !

1 Like

This would make a great custom bric :smiley:

4 Likes

Well, aren’t you just the outsourcing expert? I’ll gladly hand over the reins to you, oh wise one. :joy::tropical_drink:

Off-topic. Anyone who likes using Emoij should get this little app made by one of the developers of MacGPT.
Please donate generously. :dollar::bank:

2 Likes

Great work @Jerry - will give this a go on a project soon.

Can this be built into Blocs too you think? @Norm - next project ! give Jerry a holla !

This should be part of the standard :wink:

6 Likes

Very nice Jerry. Thank you!

Rich the Weather Guy

So how soon can we expect this bric? I’ll buy for convenience :joy:

I agree. :eyes:

4 Likes

Brilliant,! This is what what the Blocs users have been waiting for. You Rock Jerry!
https://github.com/PHPMailer/PHPMailer/archive/master.zip

What is this page?

Reply back with a way to support your brilliant work.

Jerry means a URL that is displayed when the mail is successfully sent.
PHPMailer sends the mail, if everything works this URL is called in Jerry’s script.

header("Location: $thank_you_page");
1 Like

Great post.

I have tried with some success this script.

However, when adding variables for other fields to appear in the email, I fail miserably.

Eg,

Other fields other than name, email, message

Could next Sunday’s installment cover the additional features of this script.

Thanks in advance,

Ray

Oh, this is a regular feature?
I missed that?

Rich the Weather Guy

Didn’t you get the email :rofl:

2 Likes

Yep, new series by @Jerry :+1:

1 Like

Just add them here and make sure the input field id in Blocs matches:

These are bad weather topics :cloud_with_lightning_and_rain::cloud_with_rain::cold_face::smile:

Quotation sent to @Norm. Awaiting his reply :innocent::star_struck::joy:

3 Likes

@Jerry you will need to include a tutorial on how to create some fancy markup for the email, and file upload support :grin:

3 Likes