UTL_SMTP package to send email in html or plain text
Here's the main body of my procedure which sends an email. It sends an HTML-formatted just fine, but when it sends a plain text message the whole text is strung together in the recipient's email without any carriage returns (I'm storing the emails in a clob type within my table).
Can anyone see what's wrong? Is it the v_mime_type variable ?
Thanks,
Bob Mazzo
-----------------------------------
BEGIN
mail_conn := utl_smtp.open_connection(mailhost, 25);
utl_smtp.helo(mail_conn, mailhost);
utl_smtp.mail(mail_conn, psender);
utl_smtp.rcpt(mail_conn, precipient);
v_mime_type := 'Content-Type: text/html ' || v_crlf ;
v_msg := 'From: ' || psender || '' || v_crlf ||
'Reply-To:' || preplyto || v_crlf ||
v_mime_type || 'Subject: ' || psubject || v_crlf || pmessage || v_crlf;
utl_smtp.data(mail_conn, v_msg);
utl_smtp.quit(mail_conn);
Exception
....
END;