A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Showing posts with label email. Show all posts
Showing posts with label email. Show all posts

Sending email with Perl

use Email::Stuffer; # everything else is a pain

Jenkins email notifications

The default Jenkins email notifications are almost unusable, they contain a complete output of the build log. How to set up custom notifications:
Subject: [CI] Nightly "master" test results - Build #${BUILD_NUMBER} - ${BUILD_STATUS}

Body:

Nightly master tests


Test run #${BUILD_NUMBER} for "${PROJECT_DISPLAY_NAME}"


Summary

Result: ${BUILD_STATUS} - ${TEST_COUNTS, var="fail"} failures
${TEST_COUNTS, var="pass"} out of ${TEST_COUNTS, var="total"} tests passed (${TEST_COUNTS, var="skip"} skipped).


Details

${FAILED_TESTS, showStack=false, showMessage=false}

Change quoting level in Outlook 2007

When replying to an HTML email, the original message has a blue bar to the left (which replaces the traditional > symbol). I've seen in previous versions of Outlook that pressing enter on this line takes you to a new line without the blue line ("paragraph unindent") and allows you to write a reply inline. That's fine and what I'd expect.

But currently that doesn't work and I can't easily get rid of the blue line, meaning all my inline replies look like they're part of the original message! Quite odd. Here's how to work around the problem:

  • Change the message format from HTML to Rich-text
  • Type Ctrl-Q where you want to add a reply
  • Type your reply
Voila


Outlook 2007 autocomplete doesn't work

It really doesn't.

I tried these things:
  • Adding the name to my contacts list
  • Composing and sending an email to the contact (source)
  • Tools | Address Book | Tools | Options | Check names using these address lists | Contacts
Some names are auto-completed, but some aren't.

:-(

Do you know how to make it work? Leave a comment

Outlook 2007: Don't remove line breaks

Microsoft :'-(

Outlook 2007:
Tools | Options | Preferences | E-mail Options
Untick "Remove extra line breaks in plain text messages"

(source)

How to set the follow up flag in Outlook 2007

Sometimes I click on the 'follow up' flag icon for an email in the inbox, and nothing happens. Or there's a message to say the flag was set but it doesn't change colour and doesn't appear in the to do list.

Workaround: Click on the follow up flag for a different email, then clear it, then click back on the first one.

Outlook 2007 reminder windows always on top

Hit Alt-F11, navigate to Project1 | Microsoft Office Outlook Objects | ThisOutlookSession

Simple way 

Private Sub Application_Reminder(ByVal Item As Object)
    If TypeOf Item Is AppointmentItem Then
    MsgBox "Message text", vbSystemModal, "Message title"
    End If
End Sub


(source)

Sophisticated way

Private Declare PtrSafe Function FindWindowA Lib "user32" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare PtrSafe Function SetWindowPos Lib "user32" ( _
ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal X As Long, ByVal Y As Long, ByVal cx As Long, _
ByVal cy As Long, ByVal wFlags As Long) As Long

Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const FLAGS As Long = SWP_NOMOVE Or SWP_NOSIZE
Private Const HWND_TOPMOST = -1

Private Sub Application_Reminder(ByVal Item As Object)
Dim ReminderWindowHWnd As Variant
On Error Resume Next
ReminderWindowHWnd = FindWindowA(vbNullString, "1 Reminder")
SetWindowPos ReminderWindowHWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS

End Sub

(source)

Email me that information, don't tell me out loud!

Why I want you to email me that information instead of telling me out loud. There are so many reasons:

Speaking is inefficient:

  • I could mis-hear and copy it down wrong
  • I have to spend time listening to you and writing it down somewhere
  • If I'm not in front of a computer then it's written on a piece of paper, I have to store it somewhere for future reference, or spend more time typing it up

Email is efficient:

  • You've got a record of the information for the rest of your life, with no further effort (you are using a web-based email system, right?)
  • You can search for and find the information instantly
  • You can forward it to someone else for their reference
  • You can copy and paste with no chance of error
  • Email is so fast that someone can email you while you're speaking on the phone, and you can receive it and verify that it's correct before they hang up


How to paste a table into a thunderbird email with correct formatting

How:
  • Copy table from web page
  • Paste into OpenOffice Calc (Excel)
  • Copy from Calc
  • Paste into email
done.

When Thunderbird's calendar broke

Events weren't displayed properly in Thunderbird email client and its Lightning calendar plugin, for two weeks. There were complaints.

To fix it, manually download a previous version of Thunderbird (24.0) and its associated old version of Lightning (2.6).

(Missing step here regarding how to have Synaptic recognise an old version of Thunderbird. Disabling upgrade in Synaptic may not be necessary if Thunderbird is run outside of any package manager)

Then fix them both so they don't upgrade automatically:

  • Use Synaptic package manager to find Thunderbird, the click the 'Package' menu and select 'Lock Version'.
  • For Lightning, go to Add-ons, Extensions, right-click Lightning and 'Show more information', then switch off 'Automatic Updates'.

After a while, the developers will probably fix it. After that happens, you can unlock the packages and upgrade again.

It's times like this that make me appreciate Microsoft Outlook :(

How to view .msg files on Ubuntu

wget http://www.matijs.net/software/msgconv/msgconvert.pl
sudo apt-get install libemail-outlook-message-perl
sudo apt-get install libemail-localdelivery-perl
perl msgconvert.pl YourMessage.msg

Thanks to this software

Email gateways

I want to write my tweet in an email and have it tweet for me, because I don't like most twitter clients. Email is also available on all devices (like old blackberries) where there aren't good apps.
  • ping.fm - used to work, but it got shut down
  • ifttt.com - couldn't get it to work
  • everything else - closed

Turn off gmail notification sound in Android

gmail app version 2.3.5.2:

  • go to inbox
  • press menu | more | settings
  • select your account
  • scroll down to the bottom
  • select 'Labels to notify'
  • here you can change the notification sound or disable it, set vibration and other settings

Email clients on Ubuntu

Linux email clients for Microsoft Exchange:
  • Evolution: Ugh. Clunky. Hangs.
    • "Microsoft Exchange" server type screen scrapes webmail
    • MAPI needs the 'evolution-mapi' package from Ubuntu software centre
    • Otherwise IMAP
  • Thunderbird: Pfft. Also clunky. Hangs slightly less than Evolution, sometimes.

Add-ons for Thunderbird

  • Lightning = a calendar
  • Mailbox Alert = pop up a message for important emails (first set a rule to copy them to a folder, then right click on the folder to set the Mailbox Alert)

Pop up a message box in Ubuntu

Try gmessage, xmessage or zenity (in that order)
But none of them force the window to always appear over other windows.

Prevent spammers from harvesting your email address

When you write your email address on a web page, use @ instead of @, and . instead of the dot.
That way, most email harvesting programs won't recognise it.

Here's a method using Javascript that should stop 100% of email harvesting programs.

However, just using a web contact form would work best.

Sending an email to yourself

You can't send an email from your blackberry phone, through a gmail account, and expect to see it arrive.
It just doesn't work. For reasons explained here:
http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB18070
http://www.google.com/support/forum/p/Google+Mobile/thread?tid=196b521f8b4b7a76&hl=en

Set up sendmail on linux desktop

Setting up email sending (not receiving) for XAMPP in Ubuntu.

Install Postfix:
  • sudo apt-get install postfix
  • Choose satellite system
  • Choose example.com for the system mail name (it will mean the 'hidden' Return-Path address goes to nothing, not the visible From/Reply-to address)
  • Type your ISP's SMTP address
  • Type a user for incoming email
  • Just accept the defaults for other questions
If you need to reconfigure, do sudo dpkg-reconfigure postfix

To check the version, do postconf -d | grep mail_version

PHP/XAMPP settings:
  • In php.ini, add: sendmail_path = /usr/sbin/sendmail -t
Test like this:



$email = 'you@yourdomain.com';
$headers = "From: $email\r\n";
$headers .= "Reply-To: $email\r\n";
$subject = "test subject";
$message = "test body";
print mail($email,$subject,$message,$headers) . "\n";

?>

Simple PHP email form

The 'hidden' Return-Path header (not visible Reply-To) will be your name at your domain.

Email form:

<form method="post" action="s.php">
From: <input name="from" type="text" /><br />
To: <input name="to" type="text" /><br />
Subject: <input name="subject" type="text" /><br />
Body:<br />
<textarea name="body" rows="15" cols="40">
</textarea><br />
<input type="submit" value="send"/>
</form>


s.php:

<?php
$to = $_REQUEST['to'] ;
$from = $_REQUEST['from'] ;
$subject = $_REQUEST['subject'] ;
$body = $_REQUEST['body'] ;

$return = mail( $to, $subject, $body, "From: $from\r\nReply-To: $from" );

if ($return == 1) {
print "sent.";
}
else {
print "error.";
}
?>