Reg: sending an email using report server

Hi,
i am using the below code to send an email using the report server.
When send button Click:
DECLARE
PL_ID ParamList;
repid REPORT_OBJECT;
v_rep varchar2(100);
rep_status varchar2(20);
l_host_name varchar2(50);
l_port_num varchar2(10);
l_server_name varchar2(50);
l_month_name varchar2(20);
l_from varchar2(50);
l_to varchar2(50);
l_cc varchar2(50);
l_property varchar2(1000);
l_sub_out varchar2(200);
l_sub varchar2(400);
L_BODY VARCHAR2(1000);
l_email_dir varchar2(50);
BEGIN
l_sub:=:block1.number||' '||replace(replace(:block1.desc,'&','ampersand'),'''','$quote');
if length(l_sub) >150 then
l_sub_out:=substr(l_sub,0,150);
else
l_sub_out:=l_sub;
end if;
l_host_name := (i used my host ip address local host);
l_port_num := '8889';
l_email_dir := 'C:\forms\';
l_from := [email protected];
l_cc := [email protected];
L_BODY:=' Please refer to the attached abc Report';
repid := find_report_object('PRINT_REPORT');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_FILENAME,'abc');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,MAIL);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');     
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,l_server_name);
go_block('abc_MAIL_TO');
first_record;
if :abc.email_address is not null then
loop
l_to:=:abc.email_address;
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, 'paramform=no DISTRIBUTE=YES DESTINATION='||l_email_dir||'test.xml'||' '||
' p_2='|| TO_CHAR(:control.sessionid)||' '||'P_ID='||TO_CHAR(:block1.ID)||' '
||'P_LIST_TYPE='||'A'||' '     
||'DISTRIBUTE=YES DESTINATION=test.xml'||' '
||'P_FROM='||''''||l_from||''''||' '
||'P_SEND='||''''||l_to||''''||' '
||'P_CC='||''''||l_cc||''''||' '
||'P_FILE='||'C:\testfile.txt'||' '
||'p_email_path='||l_email_dir||' '
||'P_BODY='||''''||l_body||''''||' '
||'P_NUM='||''''||'Email report: '||l_sub_out||'''');
v_rep := RUN_REPORT_OBJECT(repid);     
rep_status := REPORT_OBJECT_STATUS(v_rep);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(v_rep);
END LOOP;
IF rep_status = 'FINISHED' THEN
null;
ELSE
message(rep_status);
message('Error when sending email to: '||l_to);
END IF;
if :system.last_record='TRUE' then
exit;
else
next_record;
end if;
end loop;
end if;
message ('Mail has been sent.');
END;
In the report:
I created all the required parameters and i wrote a trigger as
function AfterPForm return boolean is
dst_file text_io.file_type;
l_email_dir varchar2(50);
begin
dst_file := text_io.fopen(:p_email_path||'test.xml','w');
text_io.putf(dst_file, '<destinations>'||chr(13));
text_io.putf(dst_file, '<mail id="ex1" '||chr(13));
text_io.putf(dst_file, 'from="&P_FROM"'||chr(13));
text_io.putf(dst_file, 'to="&P_SEND"'||chr(13));
text_io.putf(dst_file, 'cc="&P_CC"'||chr(13));
text_io.putf(dst_file, 'subject="&<P_NUM>">'||chr(13));
text_io.putf(dst_file, '<body srcType="text">'||chr(13));
text_io.putf(dst_file,'<![CDATA>'||chr(13));
text_io.putf(dst_file, '</body>'||chr(13));
text_io.putf(dst_file, '<foreach>'||chr(13));
text_io.putf(dst_file, '<attach format="pdf" name="report.pdf" srcType="report" instance="all">'||chr(13));
text_io.putf(dst_file, '<include src="mainSection"/>'||chr(13));
text_io.putf(dst_file, '</attach>'||chr(13));
text_io.putf(dst_file, '</foreach>'||chr(13));
text_io.putf(dst_file, '</mail>'||chr(13));
text_io.putf(dst_file, '</destinations>'||chr(13));
text_io.fclose(dst_file);
return (TRUE);
end;
Then after compilation i click the button send. Then i got the message as
Mail has been sent to [email protected].
But i didn't receive any mail.
then i check the report job id. It was showing job was successful .
And i check whether the test.xml file was created or not. It has created the test.xml file as below:
<destinations>
<mail id="ex1"
from="&amp;P_FROM"
to="&amp;P_SEND"
cc="&amp;P_CC"
subject="&amp;&lt;P_NUM&gt;">
<body srcType="text">
<![CDATA Please refer to the attached abc Report]>
</body>
<foreach>
<attach format="pdf" name="report.pdf" srcType="report" instance="all">
<include src="mainSection"/>
</attach>
</foreach>
</mail>
</destinations>
I have 2 machines having dev 10g. one machine is working fine with this code. but in my machine it was not working.
Do any one of you had a solution for my case.
Thanks in advance.
Edited by: user648380 on Dec 29, 2009 5:59 PM

Sorry to all.
I made a mistake in the from email address.
Instead of gmail.com i had given gmail,com
I am really sorry about it.

Similar Messages

  • Sending HTML Email Using Report Bursting

    Hello all,
    I have a requirement whereby I am sending the report as an attachment to some users and as a link to other users. Report bursting would seem to be the answer and is working well with the exception of the HTML formatted email. When attempting to email a link, my html tags are still showing up as text. I have tried using &lt; and &gt;
    I have also specified format=html in my distribution.xml file to no avail.
    Any ideas ??
    Monty

    Where are you adding your html code for the link ?
    Is it in a field in the report or are including it as part of the distribution.xml file?

  • Reg:sending a email using odisendmail

    Hi,
    OdiSendMail "-MAILHOST=pop.bizmail.yahoo.com" "[email protected] " "-SUBJECT=hi" "[email protected]"
    This above code is generated after i put the all settings in odisendmail.
    it getting error like
    javax.mail.MessagingException: Could not connect to SMTP host: pop.bizmail.yahoo.com, port: 25;
    nested exception is:
         java.net.ConnectException: Connection refused: connect
         at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
         at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
         at javax.mail.Service.connect(Service.java:275)
         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:99)
         at com.sunopsis.dwg.tools.SendMail.actionExecute(SendMail.java:220)
         at com.sunopsis.dwg.function.SnpsFunctionBase.execute(SnpsFunctionBase.java:276)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execIntegratedFunction(SnpSessTaskSql.java:3430)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeOdiCommand(SnpSessTaskSql.java:1491)
         at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:32)
         at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:1)
         at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2906)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2609)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:540)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:453)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1740)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:338)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:214)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:272)
    Regards,
    Sh

    I think your are trying to send one mail in your local. am i correct ?
    If you have IIS (Internet Information Service) you can set up smtp else you install hmailserver for windows machine and proceed with the manuals mentioned in the website.
    http://www.hmailserver.com/index.php?page=welcome
    happy mailing:)
    Thanks

  • Can we send bulk email through exchange server 2010

    can we send bulk email through exchange server 2010

    You can do this however not sure I would recommend that since if people complain they are getting spammed it could effect your production servers domain/IP, i.e. it could get black listed.   Personally I always recommend using a different system for
    email blast  to protect my production IP addresses and also to keep the load off of exchange as well as email marketing systems have built in capabilities for reporting, opt in/out capabilities etc.
    All of that said perhaps you can tell us more about what exactly it is you want to do and how often?
    Search, Recover, & Extract Mailboxes, Folders, & Email Items from Offline Exchange Mailbox and Public Folder EDB's and Live Exchange Servers or Import/Migrate direct from Offline EDB to Any Production Exchange Server, even cross version i.e. 2003 -->
    2007 --> 2010 --> 2013 with Lucid8's
    DigiScope

  • I have BIS but can't surf, send/receive email, use apps

    i have BB Curve 8520. My BIS was running smoothly (sending and receiving emails real time and surfing the net through BIS), until i noticed when i tried to reply to an email that came in, it won't send. i noticed that it's fluctuating. i was able to send the email after a few minutes... then a few minutes later, i received a replied email from my friend, and when i tried to send my reply, i wasn't able to. also, i can't surf using the browser with the "internet browser" as default. i tried using my wifi and then suddenly all my emails started coming in, all emails that were not able to go through hours ago. my big question was why do i need to turn on wifi just to receive emails. but since i had my BIS for 2 months now, i can send and receive emails and surf through BIS itself without turning on the wifi.  also, i can't use any of my apps like facebook, twitter, yahoo messenger, etc.  They used to work fine with BIS... but now, i have to turn on the wifi connection, so i could log in with them.  aren't these supposed to be running through BIS only?
    I have GPRS on top, not gprs. my carrier says i have active data plan/BIS. but under Services Status..it says Blackberry Internet Service:  Connection:  not connected...
    so, i wiped out my BB and deleted all third party apps. when this was done, i received emails telling me "Your handheld has been registered with the wireless network" and even got "Activation Server" emails telling me that the emails that i have previously set up are now up and running. so i thought my BB is now ok.. i tried surfing, it was okay. after like about 5 minutes, it was down again. tried sending email but can't... i turned on the wifi and boom! the emails started coming in again.i have the Host Routing Tables and my Service Books in my BB. I have GPRS (not gprs) on top which means i have active BIS.  i have registered my HRTs several times... and resending my service books... same thing...
    the big mystery is when i turn on the wifi, the emails suddenly go through and i can send emails. i can open apps that used to only run on BIS. this is ok i guess, but i could never do any of these if i'm not connected to wifi.
    my sister and i have the same BB... i removed my sim and inserted it to her BB and the BIS worked fine... i was able to surf and use apps.. but when i put my sim back on my phone, the problem still exists.  i even used a different sim card that is also subscribed to BIS/data plan, and it still has the same problem... my guess is my carrier is right that my data plan is working ok and that my handheld itself has the problem... 
    i updated my OS, same problem.. wiped it out... used BBSAK, reinstalled OS... numerous battery pulls... same thing... i can receive the HRTs and service books, but after that can't do anything else like i used to... (send/receive emails, use apps like facebook, twitter, ym, etc., can't surf with internet browser - except when wifi is on everything else work fine even emails and apps).. 
    i would really appreciate your help guys.. thanks!

    Hi tarifiq and welcome to the BlackBerry Support Community Forums!
    Can you send me a private message with your PIN so I can check this out for you?
    Thanks
    -CptS
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • Sending an Email using Notification Task

    Hi All,
    How can we send an email using notification task?? Can someone provide me the steps to achieve this.
    Is it possible to send email to multiple users at a time??
    Thanks.

    Good you're on 11.1.1.6. The link in Vlad and copied into my response should help then.
    You'd fill in the fields for the to, from, subject, cc, message body using variable(s) you populated upstream in the process.
    You're not there yet, but most people struggle (me included) getting the email server set up to send the emails once the process is deployed and running. Here are the steps:
    In Enterprise Manager:
    1. Expand "SOA" -> right mouse click "soa-infra" -> click "SOA Administration" -> click "Workflow Notification Properties".
    2. Select "Email" from the Notification Mode dropdown and enter email adresses for the three fields.
    3. Expand "User Message Service" -> right mouse click "usermessagingdriver-email" -> click "Email Driver Properties".
    4. Scroll down until you see the email server properties -> enter the appropriate values in these fields: OutgoingMailServer, OutgoingUsername, OutgoingPassword.
    Verify that the user(s) you want to send emails to have an email address set. If you are using the default WebLogic security, in the WebLogic Console:
    5. Click "Security Realms" -> click "myrealm".
    6. Click the "Users and Groups" tab -> click the "User" tab.
    7. Click the user id of the user you will be sending email to.
    8. Click the "Attributes" tab -> make sure the "mail" attribute has a valid email address. If it does not have an email address, once you have entered it, be sure to hit the Enter* key to have it stick in the field.

  • I can't send out email using my iPhone4. I tried to follow the step provided to solve but still not working. What should I do?

    I can't send out email using my iPhone4. I tried to follow the step provided to solve but still not working. What should I do?

    Contact your mail provider and get the CORRECT settings for the outgoing server to set up on your phone.

  • What is the effective way to Send an Email using SmtpClient Class?

    Hi Everyone
    What is the effective way to Send an Email using SmtpClient Class.
    Thanks

    Hi Shaheena
    The SmtpClient class is used to send e-mail to an SMTP server for delivery.
    This is sample code for sending an email through SMTP
    void sendEmail(string strFrom
    , string strTo
    , string strSubject
    , string strBody)
    /// Author, Md. Marufuzzaman
    /// Created,
    /// Local dependency, Microsoft .Net framework
    /// Description, Send an email using (SMTP).
    MailMessage objMailMessage = new MailMessage();
    System.Net.NetworkCredential objSMTPUserInfo =
    new System.Net.NetworkCredential();
    SmtpClient objSmtpClient = new SmtpClient();
    try
    objMailMessage.From = new MailAddress(strFrom);
    objMailMessage.To.Add(new MailAddress(strTo));
    objMailMessage.Subject = strSubject;
    objMailMessage.Body = strBody;
    objSmtpClient = new SmtpClient("172.0.0.1"); /// Server IP
    objSMTPUserInfo = new System.Net.NetworkCredential
    ("User name", "Password","Domain");
    objSmtpClient.Credentials = objSMTPUserInfo;
    objSmtpClient.UseDefaultCredentials = false;
    objSmtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
    objSmtpClient.Send(objMailMessage);
    catch (Exception ex)
    { throw ex; }
    finally
    objMailMessage = null;
    objSMTPUserInfo = null;
    objSmtpClient = null;
    Indul Hassan
    Microsoft Community Contributor
    http://www.indulhassan.com
    You Snooze.. You Lose !!

  • Send mHTML email using publication but without dynamic recipients

    I need to send the content of a report as part of the email body. I have used Publications to achieve the same. However, I do not want to use Dynamic recipients as I need the same email with the same content to go to the same list of people like a normal schedule.
    I tried not configuring the dynamic recipients and only put an email in the Destinations section but that didn't work.
    Is it possible to send mHTML emails using publication without using dynamic recipients?

    I thought you could send a publication anywhere, but I'm not sure you can - I think you have to specify recipients - either Enterprise or Dynamic.
    The 3.x admin guide says:
    ...which kinda points that way.
    HTH
    NMG

  • Sending an email Using IChannel

    I am developing a portal component which would send an email using the IChannel's sendTo method. The problem is the sendTo method takes the to and from addresses of the receiver and sender in a channel specific format. For which I could use the following code
    Does anybody know how I could get these addresses in these specific format.
    Thanks

    Hi Mukesh,
    I'm not sure I understand you correctly.
    The to and from addresses are the email addresses of the sender and the reciever.
    These are simple strings, just as you would write them in the "To:" section when you sent an ordinary e-mail.
    You can use "annonymous" as the from address if you don't have an address to send from.
    Here's an example:
    IChannel emailChannel = ChannelFactory.getInstance().getChannel(ChannelFactory.EMAIL);
    MimeMessage  msg = createMessage();
    emailChannel.sendTo("[email protected]","[email protected]",msg);
    createMessage() is for you to implement of course.
    Hope that helps,
    Yoav.

  • Sending an email using the gmail client on the iPhone

    Hello,
    When I send an email using the gmail client on the iPhone, the message I send then shows up in my 'in box' and not my 'sent' box. Mail app on my computer behaves in the same manner. Is there a fix for this?
    Thanks for your help.

    Hi, its because gmail treats each message as a "conversation" rather than emails sent or recieved. so your sent email will say "from me" all in the same inbox. check this on the web based gmail...

  • How to send secure email using JavaMail

    Hi, anyone out there know how to send secure email using Java Mail? Greately appreciated.

    For starters, if you have not already done so, read about it in the JavaMail design specifications.
    Search for Message Security in the said document.

  • How to send CC email using SO_DOCUMENT_SEND_API1

    Hi,
       How to send CC email using SO_DOCUMENT_SEND_API1.  Any sample code is very much appreciated.
    Cheers

    Please check In this function there is a flag in RECEIVERS table for sending mail as COPY or BLIND COPY

  • How to send sms,Email using java

    how to send sms,Email using java

    Hi,
    There are many sms gateways that have their own api to send sms. You can use them for sms. (They will charge you for the sms!!!)
    Moderator edit: Link removed
    Thanks
    Edited by: PhHein on 20.10.2010 16:11

  • How to send an email using XML Publisher

    Can any body help me how to send an email using XML Publisher.
    Regards,
    Suresh

    Sorry ,
    when a http://blogs.oracle.com/xmlpublisher/newsItems/departments/documentDelivery
    this it show this not answer the question.
    Thanks
    Welcome to Oracle Blogs
    Welcome to the Oracle blogging community, where Oracle executives, employees, and non-employees exchange views about customer requirements and best practices.
    We're sorry, the weblog you requested cannot be accessed.
    - You may not have the necessary permission for access the weblog.
    - This weblog does not exist.
    You may wish to try again using one of the tools below.
    - Check the URL and contact your System Administrator for access.
    - Or click here to go back to Oracle Blogs homepage.
    Powered by
    Movable Type and Oracle
    The views expressed on this blog are my own and do not necessarily reflect the views of Oracle. Terms of Use

Maybe you are looking for

  • Blank screen after undocking

    I have a user that uses her laptop as a third monitor along with her two external monitors. The problem arises when she tries to undock her laptop while the screen is up. The screen will go blank for a moment, but the screen from the primary external

  • Help - very extremely urgent! Cannot find topic necessary for homework!

    Help, help, help! I am incapable of doing my homework assignments! I have travelled a great many miles to discover and study the legend of the "My official private topic (o/t)" Thread, yet many long days of searching has turned up nothing. The legend

  • Pdf doesnt open in IE

    Why won't PDF's open when using IE?  They open just fine with Firefox

  • Export Data- csv Extremely Slow

    I am using SQL Developer 1.5.1 Build MAIN-5440 on Mac OS X 10.5.5 and the Export Data=>csv command is taking 20 minutes to show the file dialogue window. The query takes the expected amount of time and once I choose to save the file the remaining rec

  • I want to put a stylish border around my sign.

    How do I put a border around the sign I made? I made it in text, but could do it in any other app as long as it's free. Thanks!