On Friday, 25 August 2017 at 02:13:42 UTC, Adam D. Ruppe wrote:
On Tuesday, 22 August 2017 at 12:52:24 UTC, Vino.B wrote:
Request your help on sending Mails, I am able to receive mails with empty body the line "smtp.message ="Example Message" doesn't seem to be working and also please let me know how do i send a file as a attachment in a email.

The message there needs to be the complete message, including headers. The SMTP struct is pretty low-level.

My email.d (plus its dependencies, characterencodings.d, dom.d, and htmltotext.d) has the code to form a full message. It isn't very documented though.

https://github.com/adamdruppe/arsd


auto message = new EmailMessage();
message.to ~= "some@email";
message.subject = "Subject"
message.setTextBody("hi");
message.send(RelayInfo("smtp://whatever", "user", "pass"));

Hi Adam,

I am trying your email.d programming, and i am getting the below errors, can you please help me, i just used these programs (characterencodings.d, color.d, dom.d, htmltotext.d, email.d)

Program
import arsd.email;
void main() {

auto message = new EmailMessage();
message.to ~= "v...@xxx.com";
message.subject = "Test";
message.setHtmlBody("<b>1.Line 1</b><b>2.Line 2</b><b>3.Line 3</b>");
message.addAttachment("text/txt", "C:\\Temp\\test.log", "Text");
message.send(RelayInfo("smtp://smtp.xxxx.com"));
}

Error
OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
C:\Users\-TSK-X~1\AppData\Local\Temp\6\.rdmd\rdmd-dmail.d-4C543ACF04BF46D1398435D9500B3B70\objs\dmai
l.exe.obj(dmail.exe)
Error 42: Symbol Undefined __D6object__T14__switch_errorZQrFNaNbNiNfAyakZv
C:\Users\-TSK-X~1\AppData\Local\Temp\6\.rdmd\rdmd-dmail.d-4C543ACF04BF46D1398435D9500B3B70\objs\dmai
l.exe.obj(dmail.exe)
Error 42: Symbol Undefined __D4arsd10htmltotext10htmlToTextFAyabiZQg
C:\Users\-TSK-X~1\AppData\Local\Temp\6\.rdmd\rdmd-dmail.d-4C543ACF04BF46D1398435D9500B3B70\objs\dmai
l.exe.obj(dmail.exe)
 Error 42: Symbol Undefined __D4arsd10htmltotext12__ModuleInfoZ
Error: linker exited with status 3

From,
Vino.B

Reply via email to