Mail sending through oracle..
Hi,
I wish to send mail through pl/sql .. in oracle 9i.
I know its done using utl_smtp.... but dont know the steps and the required settings.
Please provide me detailed steps.
Thanks.
There is an explanation plus a demo here:
http://www.psoug.org/reference/utl_smtp.html
and here:
http://www.oracleutilities.com/Packages/utl_smtp.html
and here:
http://www.revealnet.com/newsletter-v2/smtp.htm
DISCLAIMER These were the first three results on Google for UTL_SMTP
Search is your friend!
Similar Messages
-
IPhone mail sending through Gmail not pop3?
I have a pop3 account but all email being sent through Gmail. I have deleted my Gmail account and it is still sending through Gmail. How do I get iPhone to stop using Gmail? Is there some new alliance I did not know about.
To change your email address in the mail built in app :
go to settings > mail, contacts, calendars > ( you will find your gmail account under iCloud ) tap on it then top on DELETE ACCOUNT > tap on add account to add your new address -
Is CC possible in Mails sending through ABAP?
Hello All,
My requirement is to send the requirement to MAIL reciepients ..We all know well about this from past ...
But.Can You please let me know is this possible Like putting some one in CC???
Regards
sasHi,
Please check the sample code.Its working fine. You can check the sample code by change the email IDs.
REPORT ztest_subha_mail.
DATA: l_send_request TYPE REF TO cl_bcs, " Send request
l_body TYPE bcsy_text, " Mail body
l_success TYPE bcsy_text, " Atchmnt for success
l_error TYPE bcsy_text, " Atchmnt for error
wa_text TYPE soli, " Work area for attach
l_document TYPE REF TO cl_document_bcs, " Mail body
l_sender TYPE REF TO if_sender_bcs, " Sender address
l_recipient TYPE REF TO if_recipient_bcs, " Recipient
l_size TYPE sood-objlen, " Size of Attachment
l_lines TYPE i, " Lines count
l_email TYPE ad_smtpadr, " Email ID
l_address TYPE bcsy_resv,
wa_address TYPE bcss_resv,
l_extension TYPE soodk-objtp VALUE 'RAW'. " TXT format
Prepare mail bidy
APPEND 'Send multiple file as attachment of a Email commit.' TO l_body.
APPEND space TO l_body.
Preparing contents of attachment with Change Log
Header line
wa_text-line+0 = 'First column'.
wa_text-line+20 = 'Second column'.
wa_text-line+40 = 'Third column'.
wa_text-line+60 = 'Fourth column'.
wa_text-line+80 = 'Fifth column'.
wa_text-line+100 = 'Sixth column'.
wa_text-line+120 = 'Seventh column'.
wa_text-line+140 = 'Eighth column'.
APPEND wa_text TO l_success.
APPEND wa_text TO l_error.
CLEAR : wa_text.
Populate the data part
wa_text-line+0 = '111111111'.
wa_text-line+20 = '222222222'.
wa_text-line+40 = '333333333'.
wa_text-line+60 = '333333333'.
wa_text-line+80 = '444444444'.
wa_text-line+100 = '555555555'.
wa_text-line+120 = '666666666'.
wa_text-line+140 = '777777777'.
APPEND wa_text TO l_success.
CLEAR : wa_text.
wa_text-line+0 = 'aaaaaaaaa'.
wa_text-line+20 = 'bbbbbbbbb'.
wa_text-line+40 = 'ccccccccc'.
wa_text-line+60 = 'ddddddddd'.
wa_text-line+80 = 'eeeeeeeee'.
wa_text-line+100 = 'fffffffff'.
wa_text-line+120 = 'ggggggggg'.
wa_text-line+140 = 'hhhhhhhhh'.
APPEND wa_text TO l_error.
CLEAR : wa_text.
Creates persistent send request
l_send_request = cl_bcs=>create_persistent( ).
Craete document for mail body
l_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = l_body " Mail body
i_subject = 'Mail send as attachment' ).
Attachment for success records
l_lines = LINES( l_success ).
l_size = l_lines * 255.
Add attchment
CALL METHOD l_document->add_attachment
EXPORTING
i_attachment_type = l_extension
i_attachment_subject = 'Success'
i_attachment_size = l_size
i_att_content_text = l_success. " Attachment for success record
Attachment for error records
l_lines = LINES( l_error ).
l_size = l_lines * 255.
Add attchment
CALL METHOD l_document->add_attachment
EXPORTING
i_attachment_type = l_extension
i_attachment_subject = 'Error'
i_attachment_size = l_size
i_att_content_text = l_error. " Attachment for error record
Add the document to send request
CALL METHOD l_send_request->set_document( l_document ).
Sender addess
l_sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD l_send_request->set_sender
EXPORTING
i_sender = l_sender.
Recipient address
l_email = 'TO'. " NEED TO CHANGE
l_recipient = cl_cam_address_bcs=>create_internet_address( l_email ).
Add recipient address to send request
CALL METHOD l_send_request->add_recipient
EXPORTING
i_recipient = l_recipient
i_express = 'X'
i_copy = ' '
i_blind_copy = ' '
i_no_forward = ' '.
l_email = 'CC'. " NEED TO CHANGE
l_recipient = cl_cam_address_bcs=>create_internet_address( l_email ).
Add recipient address to send request
CALL METHOD l_send_request->add_recipient
EXPORTING
i_recipient = l_recipient
i_express = 'X'
i_copy = 'X'
i_blind_copy = ' '
i_no_forward = ' '.
Trigger E-Mail immediately
l_send_request->set_send_immediately( 'X' ).
Send mail
CALL METHOD l_send_request->send( ).
COMMIT WORK.
Also you can do the same thing using the FM SO_NEW_DOCUMENT_ATT_SEND_API1
Here when you trying to create the Receipient list there for CC you need to check the field SOMLRECI1-COPY.
Thanks
Subhankar
Edited by: Subhankar Garani on Mar 4, 2010 6:46 AM -
Reg: Error in Mail sending through background job in SCOT
Hello experts,
I am trying to schedule a background job through SCOT so as to send the mails present in SOST.
The job is running but it is giving error as "Invalid status for recipient" in SOST.
But when I am sending it directly from SOST it is delivered without any errors. The email address is maintained correctly and SMTP settings are also correct as while sending it directly from SOST it reaches the required recipient without any error.
This error is observed only through background job. I am using program RSCONN01 with variant SAP&CONNECTINT in background job.
Kindly suggest why I am getting the error "Invalid status for recipient" in background job.
Thanks & Regards
Meraz
+91 8894522860I am getting the exact same issue.
were you able to fix this in the last 3 weeks?
thanks. -
CC field in mail sending through work-flow
Hi All,
I have one issue.
I want to send mail through work-flow using sendmail activity.
I can able to send mail also...but for the same mail i want to keep one more person as CC or BCC..
Is there any feature available in work-flow to keep a person in CC or any other solution..
I know this is possible using FM....something other than this...please..
Regards
Ansumesh0000 infotype(actions) run with any reason like separation or long term disabilitymeans
in Actions infotype the both are reasons right are your sure whether these are Actions reasons or action type ?
In that case identify the Code Related to MASSN which is is acton type feild name and action reason is MASSG
and deactivate for those two action type that will suffice the requirement right -
Change in sender name of mail sended through workflow
Hi All,
I have requirement where we want to chage the sender name decription for mails which are going through workflow.When we send mails through send mail step in workflow it is taking sender decription name automatically as "GSAP E1B WORKFLOW SYSTEM".
I have to change this decription to "OSIRIS Invoice". Is there any way to change sender name?
We are using SENDTASKDESCRIPTION method of SELFITEM object in send mail step.
Any help on this regards will be grate help...
Regards,
RahulHello Rahul,
here, the sender's name is the user's name of the background user performing this task, i.e. usually WF-BATCH.
If you do not have any other workflow scenarios running that could interfere here you could possibly just change that user's name.
Otherwise you have to re-program the sendmail step to specifically set the sender description.
Best regards,
Florin
P.S: Workflow issues have a separate forum:
SAP Business Workflow -
Mail sending through proxy client
I have the following simple code to send mail through a SOCKS proxy client:
package com.apna.beans;
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.DataSource;
import javax.activation.FileDataSource;
import javax.activation.DataHandler ;
public class SMail{
public static void main(String[]a){
System.setProperty("proxySet","true");
/*System.getProperties().put("http.proxyPort","25");
System.getProperties().put("http.proxyHost","192.168.0.1");*/
Properties props = System.getProperties();
String msg = "";
// Get system properties
final String username = "vedijitendra";
final String password = "sendmail";
props.put("socksProxyHost", "pc-2");
props.put("socksProxyPort", "1080");
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.user", username);
props.put("mail.smtp.auth","true"); // this is imp for authorisation.
//props.put("mail.host", "192.168.0.1");
props.put("mail.debug", "true");
props.put("mail.store.protocol", "pop3");
props.put("mail.transport.protocol", "smtp");
try{
//here the authorisation takes place using an Anonymous class.
Session session = Session.getDefaultInstance(props,
new javax.mail.Authenticator (){
protected
javax.mail.PasswordAuthentication
getPasswordAuthentication() {
return new
javax.mail.PasswordAuthentication(username,
password);
// Define message
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress("[email protected]"));
message.addRecipient( Message.RecipientType.TO, new
InternetAddress("[email protected]"));
message.setSubject("Test");
message.setContent("text", "text/html");
// Send the message
Transport.send(message);
msg = "The mail has been sent.";
} catch(Exception e){
e.printStackTrace();
msg = "The mail has not been sent.";
I am able to connect to the GMail's SMTP server.
However, when the Transport. send method is executed, I get:
java.lang.NullPointerException
at com.sun.mail.util.SocketFetcher.startTLS(SocketFetcher.java:242)
at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:1191)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:348)
at javax.mail.Service.connect(Service.java:297)
at javax.mail.Service.connect(Service.java:156)
at javax.mail.Service.connect(Service.java:105)
at javax.mail.Transport.send0(Transport.java:168)
at javax.mail.Transport.send(Transport.java:98)
Any ideas?Send email to [email protected] telling me what version of JavaMail you're
using and what version of the JDK you're using and I'll help you debug this. -
ive downloaded the javamail-1.3.3_01 and jaf-1.0.2
ive dont know where to place the mail.jar and activation.jar filesTomcat 5.0\common\lib
-
Send mails with csv file as an attachment through oracle(SQL SCripts / Stor
Hello Everybody,
I have recently come across a requirement in which I am supposed to send mails with csv file as an attachment through oracle(SQL SCripts / Stored Procedure) .
The contents of the csv file are to be retreived from the Database as well as the content of the mail and to whom it needs to be sent has also to be picked up from the database.
Can somebody suggest me with a suitable code for the same?
Would be of great help..!!
Thanks & Regards,
- VR
Edited by: user646716 on Dec 18, 2009 10:44 AMread below links
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:255615160805
http://www.orafaq.com/wiki/Send_mail_from_PL/SQL#Send_mail_with_UTL_TCP_-withattachments
How to send csv file as an attachment -
Sending an SMS or Mail to mobiles through Oracle
hi,
We have created a proc through which we can send a mail to our MailId. but my requirement is we need to send this mail as an SMS to mobiles through oracle.
Our code goes some thing like this:
CREATE OR REPLACE PROCEDURE "EMAIL_ALERT" (v_From VARCHAR2,
v_Recipient VARCHAR2,
v_Subject VARCHAR2,
v_Mail_Host VARCHAR2,
v_message VARCHAR2) AS
v_Mail_Conn utl_smtp.Connection;
crlf VARCHAR2(2) := CHR(13)||CHR(10);
v_Recipient1 VARCHAR2(50):='[email protected]';
v_Recipient2 VARCHAR2(50):='[email protected]';
v_Recipient3 VARCHAR2(50):='[email protected]';
BEGIN
v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host,25);
utl_smtp.helo(v_Mail_Conn,v_Mail_Host);
utl_smtp.Mail(v_Mail_Conn, v_From);
utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
utl_smtp.Rcpt(v_Mail_Conn, v_Recipient1);
utl_smtp.Rcpt(v_Mail_Conn, v_Recipient2);
utl_smtp.Rcpt(v_Mail_Conn, v_Recipient3);
utl_smtp.DATA(v_Mail_Conn,
'Date: ' || TO_CHAR(SYSDATE, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
'From: ' || v_From || crlf ||
'Cc:' ||v_Recipient1|| crlf ||
'Cc:' ||v_Recipient2|| crlf ||
'Cc:' ||v_Recipient3|| crlf ||
'Subject: '|| v_Subject || crlf ||
'To: ' || v_Recipient || crlf || crlf ||
'Hi,'|| utl_tcp.crlf
||' '||CHR(13)||
v_message|| utl_tcp.crlf
||' '||CHR(13)||
'Thanks and Regards'|| utl_tcp.crlf||
utl_tcp.crlf
utl_smtp.Quit(v_mail_conn);
EXCEPTION
WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error THEN
RAISE_APPLICATION_ERROR(-20000, 'Unable To Send Mail: '||SQLERRM);
END Email_Alert;
Assuming the mobile number to be 9197016944444 where 91 represent the country code . please advice.
Regards
Edited by: vine on Apr 16, 2010 5:24 AMvine wrote:
EXCEPTION
WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error THEN
RAISE_APPLICATION_ERROR(-20000, 'Unable To Send Mail: '||SQLERRM);
END Email_Alert;Ugly. What you are doing here is taking a meaningful exception and making it meaningless. The caller knows that the send mail fail. It is after all getting a raised exception in response.
What is important for the caller is to evaluate the error. Determine a) what happened and then b) determine what to do about it.
The what happened is determined from the exception error code. Only, you now went and changed the meaningful application error code to -20000.
Do not make exceptions meaningless!
>
Assuming the mobile number to be 9197016944444 where 91 represent the country code . please advice.Advice exactly what? You cannot send a SMS via e-mail.
What you can do is send a specially formatted e-mail (specific recipient/subject) to a mail server, where this mail server has special code/plug-ins/processes that can reformat the e-mail as a SMS and then forward it to a SMS gateway server that can pass it to the cellular provider's network for processing and delivery.
Do you have such a mail server? Does it interface with a SMS Gateway (or similar) server? -
Sending mail attachment through PL/SQL, message not showing in mail body
Dear All,
I am sending mail with attachment(pdf file) through oracle.
file is attached and showing.
problem is,message is not displaying in message body, it's displaying also in file attachment.
i want to show message in body.
mime setting is as follow:
mesg := mesg || 'Mime-Version: 1.0' || crlf ||
'Content-Type: multipart/mixed; boundary="' || boundary || '"' ||
crlf || crlf ||
'This is a Mime message, which your current mail reader may not' || crlf ||
'understand. Parts of the message will appear as text. If the remainder' || crlf ||
'appears as random characters in the message body, instead of as' || crlf ||
'attachments, then you''ll have to extract these parts and decode them' || crlf ||
'manually.' || crlf || crlf;
utl_smtp.write_data(conn,mesg);"
-- Write the text message or message file or message CLOB, if any
if (message is not null and length(message) > 0) or
clob_message is not null then
mesg := '--' || boundary || crlf ||
'Content-Type: text/plain; name="message.txt"; charset=US-ASCII' ||
crlf ||
'Content-Disposition: inline; filename="message.txt"' || crlf ||
'Content-Transfer-Encoding: 7bit' || crlf || crlf;
utl_smtp.write_data(conn,mesg);
if instr(message,'/') = 1 or instr(message,':\') = 2 or
instr(message,'
') = 1 then
split_path_name(message,directory_path,file_name);
append_file(directory_path,file_name,'text',conn);
utl_smtp.write_data(conn,crlf);
elsif message is not null and length(message) > 0 then
utl_smtp.write_data(conn,message);
if length(message) = 1 or
substr(message,length(message)-1) != crlf then
utl_smtp.write_data(conn,crlf);
end if;
elsif clob_message is not null then
append_file(null,'message.txt','text/plain',conn,clob_message);
end if;
end if;please helpdear, when i open this auto generated mail into outlook express, then message is showing properly, but in microsoft outlook 2007, it's showing message as text attachment.
I appreciate any hint...
thanx. -
I can no longer receive e-mail messages through my @mac/@me account, though I still seem to be able to send messages. I believe there may have been recent attempts to hack into my Mail account (my LinkedIn and Facebook accounts were both hacked three days ago and a scam/phishing message sent to my contacts, and I know there was at least an attempt made to hack into one of my e-mail accounts). I have already changed my Apple password, but how do I start receiving mail again?
(And I should also say that I'm a little surprised there was no alert from Apple of suspicious activity on my account, if such was the case. Instead, when I logged into my account via Mobile Me three days ago I noticed that all messages in my inbox were gone as well as all of my contacts. I assume this was related to the current problem.)
Thanks for all responses.The problem has been solved with the help of a MobileMe online counsellor. My MobileMe account had in fact been hacked into and the fraudster had been redirecting my e-mail messages to a phony account that he controlled. We took the forward off and reset all my passwords and security questions, which solved the immediate problem.
Thx. -
How to enable send e-mail option through browser window
Hi all,
i need to configure browser enabled e-mail sending option in my sharepoint 2013 site , here is my requirements.....
From Address : Default do not reply e-mail address
To Address : Default my E-mail address
Subject Line - Here is subject line
Body - here i need to enter my message
want to add attachments if possible ,
i have all this options using infopath form , but i need this in browser window ...
am using below code for send through outlook , but i need this with browser enabled and adding default from and to address ...
please help me with this ASAP.
Thanks,
Mani L
Mani LHi Mani,
The A tag using the MailTo: can only work with a client mail program. There's no way to send an e-mail from the server using it.
You can specify Subject and Body texts within the A tag, but you cannot specify the from and to addresses.
In order to send e-mail from the server, you'd need to use either an app-part or custom web part. I don't think you can do it through CSOM.
Paul.
EDIT: It looks like you can do it through C# CSOM, but that would require an AppPart. I can't see SendEmail in any of the JavaScript based CSOM files.
http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.utilities.utility.sendemail(v=office.15).aspx
Please ensure that you mark a question as Answered once you receive a satisfactory response. This helps people in future when searching and helps prevent the same questions being asked multiple times. -
Mail app malfunctioning, sending through wrong email
I have several emails keychained to my Mail app. I have also been using an email account which I share with several others for work related matters. This particular email is not in my keychain on the app. However, whenever I use the app to send emails, it always automatically sends through this work email. I don't understand why. I make it a point to check which email account I am sending from, but even then it inadvertantly sends from that one particular email.
HELP!First, make sure you have an outgoing mail account corresponding to each of your incoming mail accounts. The user names must match. Then make sure the right outgoing account is selected when you send. You can change the default selection in
Mail > Preferences > Composing > Send new messages from: -
How to send a oracle application report automatically to a specific e-mail
hi!!!!!
how to automatically send a mail once the oracle application report is generated ??
It should happen automatically...
Do we have to use any function for that??? or is there any other way of doing it???You can use utl_smtp package in the after report trigger to send mail after the report run is completed.
for example look at my post
Re: Sending concurrent program output as an Email to a distribution list
Maybe you are looking for
-
Playlists and the previous/next buttons
Once again, Encore proves to be difficult to work with. I have a bunch of m4v and matching ac3 files that I want to put into Encore to create a Blu-ray. However, I cannot place them all in a timeline and be done with it. Because of the null space at
-
IPhone and iPad iMessage issues...
I'm having a bit of an issue here and I assume it's on my end. Out of the blue, and only with particular contacts, a handful, when I message them my message goes through as an iMessage however they can only respond as a text. This happens on my iPhon
-
Dear friends, Can i present ALV output with Main Heading and within there r subheadings like the following ? Main Heading 01 Main Heading 02 Sub Head1 Sub Head2 sub Head3 sub Head4 s
-
Condition of Gnome Shell (git) and its issues
I had recently been able to build gnome-shell-git succesfully, but, after that, there have always been issues. I have uploaded gnome-shell-git on AUR http://aur.archlinux.org/packages.php?ID=29509, but it seems that there are some things that may be
-
Publishing website in dreamweaver
i'm using dreamweaver mx 2002 version 6.1. i want to publish my website from my localhost to the web server which is in Linux platform. I have set up the contribute connection to the web server and test successful. The problem is how i want to publis