diff options
author | Sebastian Reichel <sre@ring0.de> | 2018-07-16 16:28:11 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2018-07-17 12:17:08 +0200 |
commit | f097216aa6edaa5e9bcc1c6a785631978cfe3953 (patch) | |
tree | 2ed2a831335afe472b10a1ff14f44f9567f53083 | |
parent | 1e9d689bad5fa9a96abbc6d0a2df0f2258b1d1ab (diff) | |
download | serial-barcode-scanner-f097216aa6edaa5e9bcc1c6a785631978cfe3953.tar.bz2 |
fix mailer
-rw-r--r-- | src/mail/mail.vala | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mail/mail.vala b/src/mail/mail.vala index e1eec1d..4f9f7e3 100644 --- a/src/mail/mail.vala +++ b/src/mail/mail.vala @@ -66,8 +66,13 @@ public class MailImplementation { owned get { MailDate result = {}; var tmp = m.get_date(); - result.timezone = tmp.get_timezone_abbreviation(); - result.date = tmp.to_unix(); + if (tmp != null) { + result.timezone = tmp.get_timezone_abbreviation(); + result.date = tmp.to_unix(); + } else { + result.timezone = ""; + result.date = 0; + } return result; } set { @@ -80,6 +85,7 @@ public class MailImplementation { public MailImplementation() { m = new GMime.Message(true); m.set_header("X-Mailer", "KtT Shopsystem", "utf-8"); + m.set_date(new DateTime.now_local()); attachments = new GMime.Part[0]; filter_smtp = new GMime.FilterSmtpData(); filter_unix2dos = new GMime.FilterUnix2Dos(true); |