You're trying to send an email as a result of form processing from SSB? I just did this recently using the UTL_SMTP (which was on by default in our SSB install, though there are cases where you may need to enable java for your database if it isn't already enabled).
Here's an example:
CREATE OR REPLACE PACKAGE BODY MailTest
AS
PKGNAME VARCHAR2(10) := 'mailtest';
CURR_RELEASE VARCHAR2(10) := '7.0';
PROCEDURE P_MyEmailForm(comment IN VARCHAR2 DEFAULT NULL)
IS
Email UTL_SMTP.CONNECTION;
BEGIN
-- Validate the end user's pidm
IF NOT TWBKWBIS.F_ValidUser(PIDM) THEN
RETURN;
END IF;
-- Display the web page header template
TWBKWBIS.P_OpenDoc(PKGNAME || '.P_MyEmailForm');
-- Display a message, if any
TWBKWBIS.P_DispInfo(PKGNAME || '.P_MyEmailForm','DEFAULT');
TWBKFRMT.P_Paragraph;
HTP.Print('You''re request to whoever has been submitted.');
TWBKFRMT.P_Paragraph;
-- Display the web page footer template
TWBKWBIS.P_CloseDoc(CURR_RELEASE);
Email := UTL_SMTP.OPEN_CONNECTION('smtp.mycollege.edu');
UTL_SMTP.HELO(Email, 'smtp.mycollege.edu');
UTL_SMTP.MAIL(Email, 'noreply@mycollege.edu');
UTL_SMTP.RCPT(Email, 'finapp@mycollege.edu');
UTL_SMTP.OPEN_DATA(Email);
UTL_SMTP.WRITE_DATA(Email, 'From: "Aaron" ' || UTL_TCP.CRLF);
UTL_SMTP.WRITE_DATA(Email, 'To: "Financial Aid Applications" ' || UTL_TCP.CRLF);
UTL_SMTP.WRITE_DATA(Email, 'Subject: This is my subject line ' || UTL_TCP.CRLF);
UTL_SMTP.WRITE_DATA(Email, UTL_TCP.CRLF);
-- Compose the email body
UTL_SMTP.WRITE_DATA(Email, 'Comments: ' || UTL_TCP.CRLF || comment || UTL_TCP.CRLF);
-- Finalize and send the email
UTL_SMTP.CLOSE_DATA(Email);
UTL_SMTP.QUIT(Email);
END P_MyEmailForm;
END;
------------------------------------
Another nutty option, which is something I almost did, was leverage the use of SCT's Workflow product (if you are licensed), and create a workflow which just sends an email to a person of a particular role, and initiate the workflow through SSB. I suppose an advantage of this might be that one wouldn't necessarily have to change the code if someone's email address changes, but also that the workflows would be tracked.
Something like this?
You're trying to send an email as a result of form processing from SSB? I just did this recently using the UTL_SMTP (which was on by default in our SSB install, though there are cases where you may need to enable java for your database if it isn't already enabled).
Here's an example:
CREATE OR REPLACE PACKAGE BODY MailTest AS PKGNAME VARCHAR2(10) := 'mailtest'; CURR_RELEASE VARCHAR2(10) := '7.0'; PROCEDURE P_MyEmailForm(comment IN VARCHAR2 DEFAULT NULL) IS Email UTL_SMTP.CONNECTION; BEGIN -- Validate the end user's pidm IF NOT TWBKWBIS.F_ValidUser(PIDM) THEN RETURN; END IF; -- Display the web page header template TWBKWBIS.P_OpenDoc(PKGNAME || '.P_MyEmailForm'); -- Display a message, if any TWBKWBIS.P_DispInfo(PKGNAME || '.P_MyEmailForm','DEFAULT'); TWBKFRMT.P_Paragraph; HTP.Print('You''re request to whoever has been submitted.'); TWBKFRMT.P_Paragraph; -- Display the web page footer template TWBKWBIS.P_CloseDoc(CURR_RELEASE); Email := UTL_SMTP.OPEN_CONNECTION('smtp.mycollege.edu'); UTL_SMTP.HELO(Email, 'smtp.mycollege.edu'); UTL_SMTP.MAIL(Email, 'noreply@mycollege.edu'); UTL_SMTP.RCPT(Email, 'finapp@mycollege.edu'); UTL_SMTP.OPEN_DATA(Email); UTL_SMTP.WRITE_DATA(Email, 'From: "Aaron"' || UTL_TCP.CRLF);
UTL_SMTP.WRITE_DATA(Email, 'To: "Financial Aid Applications" ' || UTL_TCP.CRLF);
UTL_SMTP.WRITE_DATA(Email, 'Subject: This is my subject line ' || UTL_TCP.CRLF);
UTL_SMTP.WRITE_DATA(Email, UTL_TCP.CRLF);
-- Compose the email body
UTL_SMTP.WRITE_DATA(Email, 'Comments: ' || UTL_TCP.CRLF || comment || UTL_TCP.CRLF);
-- Finalize and send the email
UTL_SMTP.CLOSE_DATA(Email);
UTL_SMTP.QUIT(Email);
END P_MyEmailForm;
END;
------------------------------------
Another nutty option, which is something I almost did, was leverage the use of SCT's Workflow product (if you are licensed), and create a workflow which just sends an email to a person of a particular role, and initiate the workflow through SSB. I suppose an advantage of this might be that one wouldn't necessarily have to change the code if someone's email address changes, but also that the workflows would be tracked.
Have fun.
Thanks for your help!
Thanks for your help!