Email with html in body

Q&A's, tips, howto's
Locked
sigipa
Posts: 6
Joined: Fri Jan 30, 2015 4:06 am

Email with html in body

Post by sigipa »

Hello All,

I am new to NewLisp, so please excuse a stupid question.

I need to send html in the body of an email. I've been trying to modify the "send-mail" function in smtpx.lsp to accept an additional mail-headers argument, but I'm not having much luck. I thought I could add the argument and then add a line to the send-headers function, but that's not working. Can anyone please offer some advice on the best way to do this?

thanks,
-S

TedWalther
Posts: 608
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC
Contact:

Re: Email with html in body

Post by TedWalther »

Show us what you tried, please.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.

sigipa
Posts: 6
Joined: Fri Jan 30, 2015 4:06 am

Re: Email with html in body

Post by sigipa »

Hi,

These snippets are from the smtp.lsp file. If I run this, it just does nothing. No errors.

Code: Select all

(define (send-mail mail-from mail-to mail-subject (mail-content-type "") mail-body SMTP-server (use
r-name "") (password ""))


 (define (mail-send-header) 
    (net-send-get-result (append "TO: " mail-to)) 
    (net-send-get-result (append "FROM: " mail-from)) 
    (net-send-get-result (append "SUBJECT: " mail-subject))
    (net-send-get-result (append "Content-type: " mail-content-type))
    (net-send-get-result (append "X-Mailer: newLISP v." (string (nth -2 (sys-info)))))) 
Thanks,
-S

TedWalther
Posts: 608
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC
Contact:

Re: Email with html in body

Post by TedWalther »

It shouldn't do anything, all you are doing is defining a couple functions.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.

sigipa
Posts: 6
Joined: Fri Jan 30, 2015 4:06 am

Re: Email with html in body

Post by sigipa »

Hi,

I was just showing the changes I made to the smtp.lsp file. I am calling the send-mail function. I'll keep playing with it. I'm probably just missing something.

Thanks,
-S

TedWalther
Posts: 608
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC
Contact:

Re: Email with html in body

Post by TedWalther »

First, does it work without your modifications.

Second, show how you are calling the function with your modifications. And show how this differs from the call to the unmodified function.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.

Locked