Sending email attachements using unix !!
hi
I want to send report generated my spooled file as attachment using unix shell script.
Can somebody help me out ?
many thanks
Nothing to do with PL/SQL.
Anyway, here's a snippet from a Unix shell script I wrote that does notification (via various methods). The code snippet is from the part where an e-mail with attachment is created for the Unix mail command. The variable names are (I hope) self explanatory.
<font color="blue">
ConstructMail()
# do we have an attachment and does the file exist?
if [ "$ATTACHMENT" != "" ] && [ ! -f $ATTACHMENT ]
then
Abort "Error. File [$ATTACHMENT] not found."
fi
# create the boundary tags for the attachment
if [ "$ATTACHMENT" != "" ]
then
BASE=`basename ${ATTACHMENT}`
BOUNDS1="-"`hostname`.`date +%y%m%d%H%M`.$$
BOUNDS2="--"$BOUNDS1
fi
# now we construct a MIME e-mail that includes boundaries for e-mail
# attachments
echo "To: $EMAIL_RECIPIENT" >> $LETTER
echo "Subject: $SUBJECT" >> $LETTER
echo "MIME-Version: 1.0" >> $LETTER
if [ "$ATTACHMENT" = "" ]
then
echo "Content-Type: Text/plain; charset=US-ASCII" >> $LETTER
else
echo "Content-Type: Multipart/Mixed; Boundary=\"$BOUNDS1\"" >> $LETTER
echo "" >> $LETTER
echo "$BOUNDS2" >> $LETTER
echo "Content-Type: Text/plain; charset=US-ASCII" >> $LETTER
fi
# now let's add the message's text body
if [ -f $LETTER_BODY ]
then
cat $LETTER_BODY >> $LETTER
else
Abort "Error. Letter body [$LETTER_BODY] not found!"
fi
# if we have an attachment, let's add it now
if [ "$ATTACHMENT" != "" ]
then
echo "$BOUNDS2" >> $LETTER
echo "Content-Type: Text/plain; charset=US-ASCII; name=\"$BASE\"" >> $LETTER
cat ${ATTACHMENT} >> $LETTER
fi
</font>The only real complexity is creating the boundary tags between attachment and the mail body - and of course specifying the correct e-mail headers so that the mail reader will know what is what.
The above code creates a $LETTER file and this is then simply e-mailed using the Unix mail command, e.g.
/usr/bin/mail $RECIPIENT < $LETTER
More details in RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies. http://www.faqs.org/rfcs/rfc2045.html
Similar Messages
-
Sending email attachments using unix shell script
hi
I want to send report generated my spooled file as attachment using unix shell script.
Can somebody help me out ?
many thanksthanks a tonn it worked.
but i have another issue is it possible to add names in CC also ?
Also here is my code which spools the output of SP to a txt file. the File name is generated dynamically.
as shown below:
I need to send this generated file as attachement.
how do I do this? Here the shell script
=========================================================
#!/bin/sh
ORA_USER=scott
ORA_PWD=tiger
#Get the input parameter
if [ ! "$1" ]; then
STR="NULL"
else
STR="'"$1"'"
fi
#echo "exec pkg1($STR);"
#Connecting to oracle
sqlplus -s <<EOF
$ORA_USER/$[email protected]
---sql plus enviornment settings
set linesize 160
set pagesize 60
set serveroutput on size 1000000 for wra
set feedback off
set termout off
column dcol new_value mydate noprint
select to_char(sysdate,'YYYYMMDDHH24MISS') dcol from dual;
spool &mydate.report.txt
exec pkg1($STR);
spool off
EOF
exit
=========================================================
the file name will take sysdate as name so that every time a new file will be generated.
this file I need to send as attachment.
null -
Sending Email Attachment from UNIX using UUENCODE Command
Hi,
We are using "uuencode" command to send the mail with attachment to particular user but we are getting the mail without attachment, it's printing ASCII characters in mail body.
The command is:
uuencode $XXAR_TOP/out/${v_request_id}.csv.gz ${v_request_id}.csv.gz) |
mailx -s "Invoice Information Extract" $v_email_recipient
My requirement is to send the PDF file as an attachment.
Any setups or configuration required in UNIX box to get an attachment.
Advance Thanks
SubbuI need to send the PDF or zip file as an attachment through mail,
I tried with uuencode, it's not giving any error message but the mail recipient has only a mail with unreadable text because the pdf/zip file is directly in the mail (not as attachment).
How to send the file as an attachment from unix?
Advance Thanks
Subbu -
Send excel attachment using FM SO_NEW_DOCUMENT_ATT_SEND_API1
Hi ABAPers,
I managed to send excel attachment using FM SO_NEW_DOCUMENT_ATT_SEND_API1.
Let say I send it to my own email account.
But, when try to open the excel document, from lotus notes, there is warning message produced by the microsoft excel saying:
"The file is not in a recognizable format.
and so on....."
Anyway, when I click button 'OK', excel sheet will be opened and no information lost.
How can we code the abap program so that the message will not come each time I open the attachment from my lotus notes?
Or this is just the tab delimited issue?
Thank you.
Regards,
Edward.Hi Shan,
Thank you for replying.
I have the same as follows:
DESCRIBE TABLE lt_contents_hex LINES lv_lines.
lt_packing_list-transf_bin = 'X'.
lt_packing_list-head_start = 1.
lt_packing_list-head_num = 1.
lt_packing_list-body_start = 1.
lt_packing_list-body_num = lv_lines.
lt_packing_list-doc_type = 'XLS'.
lt_packing_list-obj_name = 'ATTACHMENT'.
lt_packing_list-obj_descr = 'Attachment'.
lt_packing_list-doc_size = lv_lines * 255.
APPEND lt_packing_list.
I'm using lt_contents_hex instead of lt_contents_bin.
Still the problem is there.
Is there any other way to calculate the doc size correctly?
Regards,
Edward. -
Logic Required to send email attachment to particular dealer number ..
I have output data saved in internal table, which has many fields from diff tables.
I need this logic as how to build .... I need to send email attachment to particular dealer number and all his related details ... dealer shldnt get other dealer details ... so i m sorting final output table details by kunnr vbeln and fkdat.
how will i write code or logic which will upload data of particular dealer number in output table one by one and send across as emails ? What i mean is for every customer numbe, his details which can be multiple needs to be send across.
I tried doing this, but didnt get any good results.
sort finaltable by kunnr vbeln fkdat.
loop at Finaltable into workarea.
at new kunnr.
perform mail send function to each customer number
endiat
endloop
Plz advise.
Thnxhi,
you can check this:
FORM docu_send_email USING pv_otfdata TYPE tsfotf
pv_emailid TYPE any
pv_formname TYPE any.
DATA: lv_filesize TYPE i,
lv_buffer TYPE string,
lv_attachment TYPE i,
lv_testo TYPE i.
DATA: li_pdfdata TYPE STANDARD TABLE OF tline,
li_mess_att TYPE STANDARD TABLE OF solisti1,
li_mtab_pdf TYPE STANDARD TABLE OF tline,
li_objpack TYPE STANDARD TABLE OF sopcklsti1,
li_objtxt TYPE STANDARD TABLE OF solisti1,
li_objbin TYPE STANDARD TABLE OF solisti1,
li_reclist TYPE STANDARD TABLE OF somlreci1,
li_objhead TYPE soli_tab.
DATA: lwa_pdfdata TYPE tline,
lwa_objpack TYPE sopcklsti1,
lwa_mess_att TYPE solisti1,
lwa_objtxt TYPE solisti1,
lwa_objbin TYPE solisti1,
lwa_reclist TYPE somlreci1,
lwa_doc_chng TYPE sodocchgi1.
CONSTANTS: lc_u TYPE char1 VALUE 'U',
lc_0 TYPE char1 VALUE '0',
lc_1 TYPE char1 VALUE '1',
lc_pdf TYPE char3 VALUE 'PDF',
lc_raw TYPE char3 VALUE 'RAW',
lc_ordform TYPE char15 VALUE 'ZORDCONFIRM_01',
lc_attachment TYPE char10 VALUE 'ATTACHMENT'.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = lc_pdf
max_linewidth = 132
IMPORTING
bin_filesize = lv_filesize
TABLES
otf = pv_otfdata
lines = li_pdfdata
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT li_pdfdata INTO lwa_pdfdata.
TRANSLATE lwa_pdfdata USING ' ~'.
CONCATENATE lv_buffer lwa_pdfdata INTO lv_buffer.
CLEAR lwa_pdfdata.
ENDLOOP.
TRANSLATE lv_buffer USING '~ '.
DO.
lwa_mess_att = lv_buffer.
APPEND lwa_mess_att TO li_mess_att.
CLEAR lwa_mess_att.
SHIFT lv_buffer LEFT BY 255 PLACES.
IF lv_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Object with PDF.
REFRESH li_objbin.
li_objbin[] = li_mess_att[].
DESCRIBE TABLE li_objbin LINES lv_attachment.
Object with main text of the mail.
lwa_objtxt = space.
APPEND lwa_objtxt TO li_objtxt.
CLEAR lwa_objtxt.
DESCRIBE TABLE li_objtxt LINES lv_testo.
Create the document which is to be sent
lwa_doc_chng-obj_name = text-008.
lwa_doc_chng-obj_descr = text-008.
lwa_doc_chng-sensitivty = lc_0.
lwa_doc_chng-obj_prio = lc_1.
lwa_doc_chng-doc_size = lv_testo * 225.
Pack to main body.
CLEAR lwa_objpack-transf_bin.
header
lwa_objpack-head_start = 1.
The document needs no header (head_num = 0)
lwa_objpack-head_num = 0.
body
lwa_objpack-body_start = 1.
lwa_objpack-body_num = lv_testo.
lwa_objpack-doc_type = lc_raw.
APPEND lwa_objpack TO li_objpack.
CLEAR lwa_objpack.
Create the attachment.
Fill the fields of the packing_list for the attachment:
lwa_objpack-transf_bin = gc_x .
header
lwa_objpack-head_start = 1.
lwa_objpack-head_num = 1.
body
lwa_objpack-body_start = 1.
lwa_objpack-body_num = lv_attachment.
lwa_objpack-doc_type = lc_pdf.
lwa_objpack-obj_name = lc_attachment.
lwa_objpack-obj_descr = text-008.
lwa_objpack-doc_size = lv_attachment * 255.
APPEND lwa_objpack TO li_objpack.
CLEAR lwa_objpack.
lwa_reclist-receiver = pv_emailid.
lwa_reclist-rec_type = lc_u.
lwa_reclist-notif_del = gc_x.
lwa_reclist-notif_ndel = gc_x.
APPEND lwa_reclist TO li_reclist.
IF li_reclist IS NOT INITIAL.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = lwa_doc_chng
put_in_outbox = gc_x
TABLES
packing_list = li_objpack
object_header = li_objhead
contents_bin = li_objbin
contents_txt = li_objtxt
receivers = li_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDFORM. " DOCU_SEND_EMAIL -
When I try to send an attachment using Word for MAC people have a hard time opening it with a PC. Can I do anything different?
shldr2thewheel already sent a teach-yourself way. Perhaps you could be more specific: any .doc file written in Mac OS is opened with difficulty? what version of Office on mac and what version in windows? any format, e.g. .doc or .rtf? Even a simple rtext of, say, 2-3 pages? or only long docs, e.g. 100 pages or more? what language is used? English or any other West European, Latin based text, or other scripts too? What do you understand by ‘people have a hard time opening it with a PC?’ takes a very long time? or does not open at all? etc. etc.
-
I am having problems sending emails when using apps. I dont receive any emails when I try to send documents such as pdf or pictures. I tried sending it to my other email account but I don't get any email. What is wrong?
System Preferences > Network > your-connection-medium > (Assist me) > ( Diagnostics )
This sometimes provides additional helpful information, sometimes not so much. -
Send email without using sender id
Hi all,
Is it possible to send email without using sender id?
Thanks in advancenvv wrote:
I m not asking this for spam. Actualy I m developing software that sends mail to many contacts. If i use sender address then they can use others like gmail, yahoo, or something like that instead.Sounds like spam software to me. -
Web jetadmin digital sending - email attachment settings
One of the settings in Web JetAdmin under DIGITAL SENDING is DIGITAL SENDING - EMAIL ATTACHMENT SETTINGS and the options are SMALL, STANDARD and LARGE.
What do these options do? What are small, standard and large? Are they detailed om Mb etc?
ThanksThis seems to be a commercial product. For the best chance at finding a solution I would suggest posting in the forum for HP Business Support!
You can find the Commercial board here:
http://h30499.www3.hp.com/t5/Print-Servers-Network-Storage/bd-p/bsc-254
Best of Luck!
You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too. -
Send PDF as email attachment using Outlook 2011 ERROR
Every time I try to send a PDF as an email attachment, I get the following error:
"An error occurred while trying to create a mail document. Acrobat is unable to complete your request."
Prior to getting this error, every time I sent an email Adobe would open the default Mail program on the mac. I opened mail and changed the preference to use Outlook 2011 as the default mail program, but this did not correct the error.
Any ideas?
Thanks!AmbooS wrote:
This is a known issue with Mac Outlook 2011 which is an unsupported version for Acrobat X. This will be supported in the next release.
If adobe was smart it would be added in the update rather than in than in AcrobatXI And while at it they need to add support for SeaMonkey and Thunderbird as well. You've been ingnoring of Dissing Mozilla Products since OSX has been out. -
Send pdf (Adobe Form) as email attachment using BCS
Hello everybody!
I want to send a pdf, generated by Adobe Forms function module, as an email attachment to a certain external mail receiver. I have read that the methods of the Business Communication Services can render this, but I couldn't create a working solution. Can somebody give me a coding example for this scenario?
I would be very happy if somebody could help me!
Best regards,
MarkusHello Alex!
your link to this document was very helpful. The scenario described in the pdf is almost what I was looking for. The only problem is, that the mail is sent to the Business Workplace Inbox. I want to send it to an external e-mail address. When I change the programm part where the recipient is defined like this:
Create recipient
DATA lo_recipient TYPE REF TO if_recipient_bcs VALUE IS INITIAL.
DATA l_reci TYPE adr6-smtp_addr VALUE 'somemailaddress'.
lo_recipient = cl_cam_address_bcs=>create_internet_address( l_reci ).
Set sender
lo_send_request->add_recipient(
EXPORTING
i_recipient = lo_recipient ).
then no mail is sent to the recipients mailbox. I tried several variants but no mail is sent. Does somebody know how to set an external e-mail as recipient in this case?
Best regards!
Markus -
[Request For Help] How To Send Email Midlet Using Secure Socket ?
Hello, this is the first time i ask for help to forum.sun.com.
i try to make secure connection for send email from MIDlet. Maybe you can check to my code :
EmailMidlet.java
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.lcdui.;
public class EmailMidlet extends MIDlet implements CommandListener{
Display display = null;
// email form fields
TextField toField = null;
TextField subjectField = null;
TextField msgField = null;
Form form;
static final Command sendCommand = new Command("send", Command.OK, 2);
static final Command clearCommand = new Command("clear", Command.STOP, 3);
String to;
String subject;
String msg;
public EmailMidlet() {
display = Display.getDisplay(this);
form = new Form("Compose Message");
toField = new TextField("To:", "", 50, TextField.EMAILADDR);
subjectField = new TextField("Subject:", "", 15, TextField.ANY);
msgField = new TextField("MsgBody:", "", 90, TextField.ANY);
public void startApp() throws MIDletStateChangeException {
form.append(toField);
form.append(subjectField);
form.append(msgField);
form.addCommand(clearCommand);
form.addCommand(sendCommand);
form.setCommandListener(this);
display.setCurrent(form);
public void pauseApp() {
public void destroyApp(boolean unconditional) {
notifyDestroyed();
public void commandAction(Command c, Displayable d) {
String label = c.getLabel();
if(label.equals("clear")) {
destroyApp(true);
} else if (label.equals("send")) {
to = toField.getString();
subject = subjectField.getString();
msg = msgField.getString();
EmailClient client = new EmailClient(this,"[email protected]", to, subject, msg);
client.start();
}and EmailClient.java
import javax.microedition.io.;
import javax.microedition.lcdui.;
import java.io.;
import java.util.Date;
public class EmailClient implements Runnable {
private EmailMidlet parent;
private Display display;
private Form f;
private StringItem si;
private SecureConnection sc; //SSL
private InputStream is;
private OutputStream os;
private String smtpServerAddress = "smtp.gmail.com"; //SSL
String from;
String to;
String subject;
String msg;
public EmailClient(EmailMidlet m, String from, String to, String subject, String msg) {
parent = m;
this.from = from;
this.to = to;
this.subject = subject;
this.msg = msg;
display = Display.getDisplay(parent);
f = new Form("Email Client");
si = new StringItem("Response:" , " ");
f.append(si);
display.setCurrent(f);
public void start() {
Thread t = new Thread(this);
t.start();
public void run() {
try {
//SSL
sc = (SecureConnection)
Connector.open("ssl://"smtpServerAddress":465"); //smtp with SSL port 465
sc.setSocketOption(SocketConnection.LINGER, 5);
is = sc.openInputStream();
os = sc.openOutputStream();
os.write(("HELO there" "\r\n").getBytes());
os.write(("EHLO" "\r\n").getBytes());
os.write(("auth login" "\r\n").getBytes());
os.write(("dHVnYXNha2hpci50cmlhZGl0eWFAZ21haWwuY29t" "\r\n").getBytes());
os.write(("dGEuZW1haWxjbGllbnQ=" "\r\n").getBytes());
os.write(("MAIL FROM:<">\r\n").getBytes());
os.write(("RCPT TO:<">\r\n").getBytes());
os.write("DATA\r\n".getBytes());
// stamp the msg with date
os.write(("Date: " new Date() "\r\n").getBytes());
os.write(("From: "+from"\r\n").getBytes());
os.write(("To: "to"\r\n").getBytes());
os.write(("Subject: "subject"\r\n").getBytes());
os.write((msg+"\r\n").getBytes()); // message body
os.write(".\r\n".getBytes());
os.write("QUIT\r\n".getBytes());
StringBuffer sb = new StringBuffer();
int ch = 0;
while((ch = is.read()) != -1) {
sb.append((char) ch);
si.setText("SMTP server response - " + sb.toString());
} catch(IOException e) {
e.printStackTrace();
Alert a = new Alert
("TimeClient", "Cannot connect to SMTP server. Ping the server to make sure it is running...", null, AlertType.ERROR);
a.setTimeout(Alert.FOREVER);
display.setCurrent(a);
} finally {
try {
if(is != null) {
is.close();
if(os != null) {
os.close();
if(sc != null) {
sc.close();
} catch(IOException e) {
e.printStackTrace();
public void commandAction(Command c, Displayable s) {
if (c == Alert.DISMISS_COMMAND) {
parent.notifyDestroyed();
parent.destroyApp(true);
} When I try to debug project from netbeans, i found this error :
Starting emulator in debug server mode on port 2668
Connecting to 127.0.0.1 on port 2800
nbdebug:
Waiting for debugger on port 2668
Waiting for KVM...
Running with storage root temp.SonyEricsson_JP8_128x160_Emu10
KdpDebugTask connecting to debugger 1 ..
Running with locale: Indonesian_Indonesia.1252
Connected to KVM
Connection received.
Attached JPDA debugger to localhost:2668
java.io.IOException: error 10054 during TCP read +
at com.sun.midp.io.j2me.socket.Protocol.nonBufferedRead(Protocol.java:299)+
at com.sun.midp.io.BufferedConnectionAdapter.readBytes(BufferedConnectionAdapter.java:99)+
at com.sun.midp.io.BaseInputStream.read(ConnectionBaseAdapter.java:582)+
at com.sun.midp.ssl.Record.rdRec(+41)+
at com.sun.midp.ssl.Record.rdRec(+5)+
at com.sun.midp.ssl.In.refill(+18)+
at com.sun.midp.ssl.In.read(+29)+
at EmailClient.run(EmailClient.java:74)+
Execution completed.
5145824 bytecodes executed
9258 thread switches
1762 classes in the system (including system classes)
0 dynamic objects allocated (0 bytes)
0 garbage collections (0 bytes collected)
debug:
BUILD SUCCESSFUL (total time: 4 minutes 34 seconds)
Regard
LittlebroDon't multipost and don't use the browser's back button to edit your posts as that creates multiple postings. I've removed the other thread you started with the same questio.
Also, don't post to long dead threads. I've blocked your post and locked the thread you resurrected.
db -
Send Email Attaching the Report generated in Program.
Hi All,
I am generating a report in list format with write statements.
My requirement is to send an email attaching this report as an attachment.
I wanted to know how to get the listobject of the report generated by my program from the memory. Can anyone guide me with this ?
It will be appreciable , If any one can give me more information on sending mails attaching the reports generated by the program.
Thanks in advance,
MayankHi,
I think the problem is not clear.
My problem is to get the listobject name which got generated after the program run.I want to attach this list report to the email. I have seen a code from one of the link.
Here it is.
List of Users According to Logon Date and Password Change
NOTE: Create ALI/OTF Document in Spool
SUBMIT rsusr200 WITH valid = 'X'
WITH notvalid = space
WITH unlocked = 'X'
WITH locked = space
EXPORTING LIST TO MEMORY AND RETURN.
<b>* Read list from memory into table
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = lt_listobject
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
Error in function module &1
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.</b>
Because listobject is of size RAW(1000)
and objbin is of size CHAR(255) we make this table copy
CALL FUNCTION 'TABLE_COMPRESS'
TABLES
in = lt_listobject
out = lt_objbin
EXCEPTIONS
compress_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
Error in function module &1
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
Here the report is sumitted with the option of exporting the list in to the memory which is later read using 'LIST_FROM_MEMORY'.
But here i need the same report's output to be captured and want to read the list generated from memory into table.
How can i get the listobject of the list generated by the report in the same report program itself ??
Please let me know.
Mayank -
Send email error using Wireless
Please someone helpme!
When I attach one file into a email message using a wireless device, the follow error occurs :
Fail to send message
Regards
RafaelThough it doesn't solve your issue, I thought I'd
share that I can access many non-Apple access points
(Cisco 1200's, Linksys WAP54G's for example) with OS
10.4.4. This being so, I think we're safe to assume
the issue is not related to a recent OS update.
I'm afraid I must disagree with this. Few months back, I lost my Airport connection when I installed the 10.4.3 System Update. Fixed by restoring from backup and going back to 10.4.3. Managed to upgrade to 10.4.4 successfully and maintain wireless connection to a Compex 802.11g base station. Then I made the mistake of accepting the Airport 2005-001 update. Immediately lost my Airport connection. Other PCs can connect to the base station, and I can access the internet by connecting my Powerbook to the router using Ethernet. Can even see the Airport network and login to the router's admin page over wireless. Only thing that doesn't work is connecting to the internet wirelessly.
Once I changed my base station to an older one I had lying around, I can connect wirelessly again and all seems well.
My conclusion is that Airport Update 2005-001 definitely broke compatibility between Airport Extreme and some 3rd party base stations. The irony is that this update was supposed to "improve" compatibility ! -
Hi!
I'm new at apex and so far this forum was very helpful. But now I can't find a solution to my problem. So here it goes.
I have a standard report with a checkbox which stores user's id. Now I want to send email to all users who has been checked
with certain data for those users. This is working perfectly. The problem is the attachment file. Client wants that the attachment
file contains data which are meant only for him. For example. I'm sending mail to userA, UserC and userG. The attachment file
for userA must contain data about userA, the attachment file for userc must contain data about userC... The idea is that I make a
report with BI Publisher and use this report as attachment. This is working fine, but in the report query for this template I
don't know how to reference only checked values and how to know in the process of sending email which user is being processed
so I can reference this user in report query. The problem is that the report query is made independently from process of sending email.
Is there a way perhaps making a report query for template dynamically?
Process of sending email looks something like this:
for i in 1..apex_application.g_f01.count
loop
select email into posta from upor where user_st=apex_application.g_f01(i);
datoteka:=apex_util.get_print_document(
p_application_id=>'101',
p_report_query_name=>'priloga',
p_report_layout_name=>'priloga',
p_report_layout_type=>'rtf',
p_document_format=>'rtf');
st_poste:=apex_mail.send(
p_to=>posta,
p_from=>[email protected],
p_body=>mess,
p_subj=>'Subject');
apex_mail.add_attachment(
p_mail_id=>st_poste,
p_attachment=>datoteka,
p_filename=>'priloga.rtf',
p_mime_type=>'application/rtf');
end loop;
If you have a different solution how to solve this, I'm open to ideas.
ThanksWhat I would suggest is doing this in pieces.. You need to build a report based upon certain data elements for a user, correct? get your report working for this case, then look at this article on how to build reports to be saved as blob in your schema : http://www.oracle.com/technology/obe/hol08/apexprnt/apexprnt3_otn.htm.
After that you can look at building a batch job to do the following:
run your reports to build blob columns in a table, along with associated e-mail address
loop through the table and send e-mails from each row's data
thank you,
Tony Miller
Webster, TX
Maybe you are looking for
-
First time poster, but I think I've done my homework on this issue. This issue has similar symptoms to a problem with vista: http://www.vistax64.com/tutorials/130095-user-profile-service-failed-logon-user-profile-cannot-loaded.html However, it is def
-
Display Repeated Values in a Crosstab - Design Studio 1.2
I've a report in Design Studio from a Bex query. There are repeated values in few columns which Design Studio 1.2 refuses to display. note: I've already unchecked the box "Hide Repeated Key Values" in the query properties of Bex query designer and i'
-
"Show Transform Controls" Equivalent in Flash CS4? + Other Questions
Hi everyone. I've been using Adobe Flash CS3 & CS4, and I still find it ridiculously hard to navigate around that Program sometimes, mainly when I have to deal with a Pre-made Flash website that needs Editing. Allot of people Label layers, Symbols, e
-
ValidTo and ValidFrom for privileges and roles (since SP2) - no effect
Hi IDM Community, has anybody tried the new functionality that you can enter validfrom and validto values for role assignments and privilege assignments in business roles? In my case I can define these values in a workflow but I don't see any effect.
-
I need to send Obj A but not Obj B which is referenced
I'm having a problem with my serialization. Here's the set up: The server creates an instance of Obj A and Obj B, which contain references to each other. I want to serialize Obj A and send it to the client, but not Obj B. First I tried setting Obj A'