Snippets Collections
<!-- This tells you if your device is dark mode enabled or not. -->
<meta name=”color-scheme” content=”light dark”>
<meta name=”supported-color-schemes” content=”light dark”>
<style type=”text/css”>
:root {
Color-scheme: light dark;
supported-color-schemes:light dark;
}
</style>

/* Here you can adjust the colors of your brand’s preferred dark mode theme. */
@media (prefers-color-scheme: dark ) {
.body {
      background-color: #CCCCCC !important;
}
h1, h2, h3, td {
      color: #9ea1f9 !important;
      padding: 0px 0px 0px 0px !important;
}
}
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;

public class SendEmail {
    public static void main(String[] args) {
        final String username = "your_email@example.com";
        final String password = "your_password";

        Properties props = new Properties();
        props.put("mail.smtp.auth", "true");
        props.put("mail.smtp.starttls.enable", "true");
        props.put("mail.smtp.host", "smtp.example.com"); // Replace with your SMTP server
        props.put("mail.smtp.port", "587"); // Port number may vary

        Session session = Session.getInstance(props, new Authenticator() {
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication(username, password);
            }
        });

        try {
            Message message = new MimeMessage(session);
            message.setFrom(new InternetAddress("your_email@example.com")); // Replace with your email
            message.setRecipients(Message.RecipientType.TO, InternetAddress.parse("recipient@example.com")); // Replace with recipient's email
            message.setSubject("Test Email");
            message.setText("This is a test email sent using JavaMail.");

            Transport.send(message);

            System.out.println("Email sent successfully.");
        } catch (MessagingException e) {
            System.out.println("Email sending failed. Error: " + e.getMessage());
        }
    }
}
$to = "recipient@example.com";
$subject = "Test Email";
$message = "This is a test email sent using PHP's mail() function.";
$headers = "From: sender@example.com";

if (mail($to, $subject, $message, $headers)) {
    echo "Email sent successfully.";
} else {
    echo "Email sending failed.";
}
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,

    /* Optional EmailOutbound */

    email, /* Optional GlideRecord */ email_action,

    /* Optional GlideRecord */

    event) {

​

    if (current.technical_review == 'Yes'); {

        a = current.technology_leadership_approver.email.toString();

        b = current.technology_leadership_approver.getDisplayValue();

        email.addAddress('cc', a, b);

    }

​

})(current, template, email, email_action, event);
	<?php
// 	if ( $sent_to_admin ) {
// 		$before = '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">';
// 		$after  = '</a>';
// 	} else {
// 		$before = '';
// 		$after  = '';
// 	}
	
	$before = '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">';
	$after  = '</a>';
	
Auth.auth().currentUser?.sendEmailVerification()
/**
 * Plugin Name:       My Basics Plugin
 * Plugin URI:        https://example.com/plugins/the-basics/
 * Description:       Handle the basics with this plugin.
 * Version:           1.10.3
 * Requires at least: 5.2
 * Requires PHP:      7.2
 * Author:            John Smith
 * Author URI:        https://author.example.com/
 * License:           GPL v2 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Update URI:        https://example.com/my-plugin/
 * Text Domain:       my-basics-plugin
 * Domain Path:       /languages
 */
<div style="display:none">
  Preheader text... &#847; &#847; &#847; &#847; &#847; &#847; &#847; &#847;&#847; &#847; &#847; &#847; &#847; &#847; &#847; &#847;&#847; &#847; &#847; &#847; &#847; &#847; &#847; &#847;&#847; &#847; &#847; &#847; &#847; &#847; &#847; &#847;&#847; &#847; &#847; &#847; &#847; &#847; &#847; &#847;&#847; &#847; &#847; &#847; &#847; &#847; &#847; &#847;&#847; &#847; &#847; &#847; &#847; &#847; &#847; &#847;&#847; &#847; &#847; &#847; &#847; &#847; &#847; &#847;&#847; &#847; &#847; &#847; &#847; &#847; &#847; &#847;&#847; &#847; &#847; &#847; &#847; &#847; &#847; &#847;&#847; &#847; &#847; &#847; &#847; &#847; &#847; &#847;&#847; &#847; &#847; &#847; &#847; &#847; &#847; &#847;&#847; &#847; &#847; &#847; &#847; &#847; &#847; &#847;&#847; &#847; &#847; &#847; &#847; &#847; &#847; &#847;&#847; &#847; &#847; &#847; &#847; &#847; &#847; &#847;
</div>
<style>
    @media all and (max-width: 600px) {
    .table-wrapper {
      width: 95%;
    }
    .td-inline {
      display: inline-table !important;
      width: 100%;
    }
    .img-100 img {
      width: 100%;
      height: auto; 
    }
    
    .show {
      display: block;
    }
    
    }
</style>


<!-- Image left + Text Right-->
<table width="638" border="0" cellpadding="0" cellspacing="0" align="center" class="table-wrapper" style="background: #f4f5f6">
    <tr>
        <td>
            <!-- Image -->
            <table cellpadding="0" cellspacing="0" border="0" align="left" class="td-inline" width="48%">
                <tr>
                    <td class="img-100">
                        <img src="https://images.unsplash.com/photo-1510771463146-e89e6e86560e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=327&q=80" width="310" height="auto" alt="blank" style="display: block" border="0" />
                    </td>
                </tr>
            </table>
            <!-- Text -->
            <table cellpadding="0" cellspacing="0" border="0" align="left" class="td-inline" width="50%">
                <tr>
                    <td width="30" class="width-20"></td>
                    <td align="center">
                        <table cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
                            <tr>
                                <td height="34" class="height-10"></td>
                            </tr>
                            <tr>
                                <td style="
                        font-size: 28px;
                        font-weight: 500;
                        font-family: 'Open Sans', Arial, sans-serif;
                        line-height: 1.3;
                      ">
                                    Lorem ipsum dolor sit amet
                                </td>
                            </tr>
                            <tr>
                                <td height="16" class="height-10mid"></td>
                            </tr>

                            <tr>
                                <td style="
                        font-size: 18px;
                        font-family: 'Open Sans', Arial, sans-serif;
                        line-height: 1.5;
                      ">
                                    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                                </td>
                            </tr>
                            <tr>
                                <td height="30"></td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <table cellpadding="0" cellspacing="0" border="0" align="left">
                                        <tr>
                                            <td width="200" align="center" height="45" style="border: 2px solid #000">
                                                <a target="_blank" href="#" style="
                                font-size: 18px;
                                     color: #000;
                                text-transform: uppercase;
                                font-family: 'Open Sans', Arial, sans-serif;
                                font-weight: 700;
                                text-align: center;
                                display: block;
                                line-height: 45px;
                                vertical-align: middle;
                                text-decoration: none;
                              ">Shop the Sale</a>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr class="show">
                                <td height="20"></td>
                            </tr>
                        </table>
                    </td>
                    <td width="30"></td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<!-- End Image left + Text Right -->

<!-- Blank space / divider -->
<table width="640" border="0" cellpadding="0" cellspacing="0" align="center" class="table-wrapper" style="background: #f4f5f6">
    <tr>
        <td height="40" class="mob-height-20"></td>
    </tr>
</table>
<!-- End Blank space / divider -->

<!-- Text Left - Image Right -->
<table width="638" border="0" cellpadding="0" cellspacing="0" dir="ltr" align="center" class="table-wrapper" style="background: #f4f5f6">
    <tr>
        <td>
            <!-- Image -->
            <table cellpadding="0" cellspacing="0" border="0" align="right" class="td-inline" width="48%">
                <tr>
                    <td class="img-100">
                        <img src="https://images.unsplash.com/photo-1586671267731-da2cf3ceeb80?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=389&q=80" width="310" height="auto" alt="blank" style="display: block" border="0" />
                    </td>
                </tr>
            </table>
            <!-- Text -->
            <table cellpadding="0" cellspacing="0" border="0" align="left" class="td-inline" width="50%">
                <tr>
                    <td width="30" class="width-20"></td>
                    <td align="center">
                        <table cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
                            <tr>
                                <td height="34"></td>
                            </tr>
                            <tr>
                                <td style="
                        font-size: 28px;
                        font-weight: 500;
                        color: #000;
                        font-family: 'Open Sans', Arial, sans-serif;
                        line-height: 1.3;
                      ">
                                    Lorem ipsum dolor sit amet
                                </td>
                            </tr>
                            <tr>
                                <td height="16"></td>
                            </tr>

                            <tr>
                                <td style="
                        font-size: 18px;
                        color: #000;
                        font-family: 'Open Sans', Arial, sans-serif;
                        line-height: 1.5;
                      ">
                                    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                                </td>
                            </tr>
                            <tr>
                                <td height="30"></td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <table cellpadding="0" cellspacing="0" border="0" align="left">
                                        <tr>
                                            <td width="200" align="center" height="45" style="border: 2px solid #000">
                                                <a target="_blank" href="#" style="
                                font-size: 18px;
                                color: #000;
                                text-transform: uppercase;
                                font-family: 'Open Sans', Arial, sans-serif;
                                font-weight: 700;
                                text-align: center;
                                display: block;
                                line-height: 45px;
                                vertical-align: middle;
                                text-decoration: none;
                              ">Watch the Video</a>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr class="show">
                                <td height="20"></td>
                            </tr>
                        </table>
                    </td>
                    <td width="30"></td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<!-- End Text Left - Image Right -->
/**
 * Provides strict e-mail address verification close to RFC
 * Includes support for unicode
 *
 * @param   <string>  E-mail address to verify
 * @returns <boolean> Returns true if e-mail address is considered to be valid,
 *                    false otherwise
 */

export default function validateEmail (email) {
    return typeof email === 'string' &&
        email &&
        email.length < 256 &&
        /^(?:[0-z!#$%&'*+/=?^_`{|}.~-]|[^\u0000-\u007F]){1,64}@(?:(?:[0-z-]|[^\u0000-\u007F]){1,62}\.)+(?:[0-z]|[^\u0000-\u007F]){2,63}$/i.test(email) &&
        !email.includes('..') &&
        !email.startsWith('.') &&
        !email.includes('.@') &&
        !email.includes('-.') &&
        !email.includes('.-')
}
const validateEmail = email => {
    const regex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
    return regex.test(String(email).toLowerCase());
  }
add_filter( 'woocommerce_email_attachments', 'attach_downloadable_files_to_customer_completed_email', 10, 3 );
function attach_downloadable_files_to_customer_completed_email( $attachments, $email_id, $order ) {
    if( isset( $email_id ) && $email_id === 'customer_completed_order' ){
        // Loop through order items
        foreach( $order->get_items() as $item ) {
            $product = $item->get_product(); // The product Object

            if ( $product->is_downloadable() && ( $downloads = $product->get_downloads() ) ) {
                // Loop through product downloads
                foreach( $downloads as $download ) {
                    $attachments[] = $download->get_file();
                }
            }
        }
    }
    return $attachments;
}
app.get('/:id/tracker.png', function(request, response, next) {
    var emailId = request.param.id;
    var buf = new Buffer([
        0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x01, 0x00, 0x01, 0x00,
        0x80, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x2c,
        0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02,
        0x02, 0x44, 0x01, 0x00, 0x3b
    ]);
    response.set('Content-Type', 'image/png');
    response.end(buf, 'binary');
    db.findOne({ id: emailId }, function(error, email) {
        if(error) return next(error);
        app.emit('event:opened', email);
    });
});

app.on('event:opened', function(email) {
    console.log('Email was opened');
    console.log(email.to);
    console.log(email.subject);
});
star

Tue Nov 21 2023 08:13:13 GMT+0000 (Coordinated Universal Time) https://www.emailaudience.com/dark-mode-email/

#css #mark-up #email
star

Fri Aug 25 2023 09:12:25 GMT+0000 (Coordinated Universal Time)

#email #java
star

Fri Aug 25 2023 08:08:20 GMT+0000 (Coordinated Universal Time)

#php #email
star

Sat Jun 17 2023 21:43:59 GMT+0000 (Coordinated Universal Time) https://epsilondev.service-now.com/sys_script_email.do?sys_id

#email #script
star

Tue Dec 27 2022 12:22:59 GMT+0000 (Coordinated Universal Time)

#ios #swift #email #verify
star

Mon Aug 08 2022 04:46:18 GMT+0000 (Coordinated Universal Time) https://developer.wordpress.org/plugins/plugin-basics/header-requirements/

#php #email #form #wordpress #header
star

Tue Mar 01 2022 16:37:47 GMT+0000 (Coordinated Universal Time) https://www.goodemailcode.com/email-code/preheader

##preheader #email
star

Thu Feb 17 2022 22:16:10 GMT+0000 (Coordinated Universal Time)

#html #css #email #tables
star

Sat Jan 08 2022 06:40:20 GMT+0000 (Coordinated Universal Time) https://gist.github.com/juliyvchirkov/30337123712f345fab264516800d6302

#javascript #email #validation
star

Thu Oct 14 2021 19:02:39 GMT+0000 (Coordinated Universal Time)

#javascript #regex #email
star

Fri Feb 26 2021 06:08:43 GMT+0000 (Coordinated Universal Time)

#woocommerce #downloads #email
star

Thu Jan 07 2021 22:05:21 GMT+0000 (Coordinated Universal Time) https://www.reddit.com/r/node/comments/4txqqw/how_to_track_email_opens_with_nodejs_app/

#nodejs #javascript #email
star

Tue Nov 10 2020 15:39:18 GMT+0000 (Coordinated Universal Time) https://es.stackoverflow.com/questions/218143/envio-de-mail-con-archivo-adjunto-laravel

#email #laravel

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension