Send email via SQL attachment to multiple recipients error

Hello

I found the code below on this site in a post. I changed to my database and it works very well. The email is sent to the recipient with the attached to CSV file. Saving time huge and very grateful.

What I'm trying to accomplish is now email to send to multiple recipients. When I try to separate the names of beneficiaries by a comma or a semicolon, I get the following error.

Error report:

ORA-29279: SMTP permanent error: 501 5.1.3 address not valid

ORA-06512: at "SYS." UTL_SMTP", line 54

ORA-06512: at "SYS." UTL_SMTP", line 140

ORA-06512: at "SYS." UTL_SMTP", line 488

ORA-06512: at line 14

  1. 00000 - "SMTP permanent error: %s."

* Cause: A permanent SMTP error occurred.

* Action: Correct the error and retry the operation of SMTP.

I thought that this issue would have been made upwards already, but when I search the site I can't find a post that solves my problem. If anyone knows how to fix this or point me in the right direction, I would be very grateful.

Thank you

declare

SMTP UTL_SMTP.connection;

response UTL_SMTP.reply;

v_lbl_str VARCHAR2 (5000);

procedure W (line varchar2 default null value) is

Start

UTL_SMTP.write_data (smtp, line | utl_tcp.) CRLF);

end;

Start

SMTP: = UTL_SMTP.open_connection ("serverinfo", 25);

-/ / IMPORTANT: specify the host name of the platform sends mail!

UTL_SMTP. HELO (smtp, sys_context ('name', 'host'));

UTL_SMTP.mail (smtp, ' [email protected]'); - that THE MAIL IS COMING FROM

UTL_SMTP.rcpt (smtp, ' [email protected]')-WHO THE MAIL IS GOING TO

UTL_SMTP.open_data (smtp);

-/ / mail header

W ("MIME-Version: 1.0 '");

W (' Content-Type: multipart/mixed; limit = "-_ = _NextPart_001_01C87DCB.") (CD85F300"');

W (' topic: topic); -THE SUBJECT OF THE EMAIL

W (' from: user@company' "); -NAME OF SHOW ON TEH LINE

W (' TO: [email protected]'); - NAMES OF SHOW ON THE to LINE

-/ / mail body text

W() ;

W ('-_ = _NextPart_001_01C87DCB.) CD85F300');

W (' Content-Transfer-Encoding: 8 bit "");

W (' Content-Type: text/plain "");

W() ;

W ("Hello");

W() ;

W ('words.');

W( '');

W() ;

W ("cordially,");

W ("person");

W() ;

W ("PS: it is a system generated email.'");

-/ / mail attachment

W() ;

W ('-_ = _NextPart_001_01C87DCB.) CD85F300');

W (' Content-Disposition: attachment; filename = "filename.csv' '");

W (' Content-Type: text/plain "");

W() ;

W ('headers1' |) ','|| "in-tete2"); -THIS WILL WRITE THE HEADERS ON THE ATTACHMENT

FOR C IN (SELECT header1, tete2 table)

Loop

W (c.header1 | ',' | c.header2);

End loop;

W ('-_ = _NextPart_001_01C87DCB.) CD85F300');

UTL_SMTP.close_data (smtp);

UTL_SMTP. Quit (smtp);

end;

For each recipient, you must run the command recipient. If you need code UTL_SMTP.rcpt () for each recipient. For example

UTL_SMTP. RCPT (smtp, ' [email protected]');

UTL_SMTP. RCPT (smtp, ' [email protected]');

You must also change your e-mail header to indicate who receives mail. The email itself is text - and you must make sure that it is correct. The SMTP server does not rewrite the mail headers to show user1 and user2 has received the e-mail message. Your code must do this.

For example

-write FROM and TO e-mail headers

W (' of: Tom [email protected]> ');

W (' to: Harry [email protected]>, Sally [email protected]> ');

If you want to CC or BCC a person - all simply add a call to UTL_SMTP.rcpt () to the e-mail address of that person and change the header of e-mail message accordingly. (i.e. in the case of a KIC, you would omit his name and address in the e-mail message header).

Tags: Database

Similar Questions

  • Microsoft Silverlight send emails via my account that I did not send?

    How Microsoft Silverlight is send emails via my account that I did not send, with the recipients cannot open attachments?

    Hello
    1. who is the service provider of electronic mail to the e-mail address concerned?
    2. do you use e-mail clients (like Microsoft Outlook, Windows Live Mail etc.) to send and receive e-mails?
    When emails are automatically sent an e-mail address, it is generally a compromise e-mail address... I suggest to change the security issues and password of the e-mail concerned as soon as possible and contact the e-mail service provider for help on this issue.
    Hope this information helps.
  • Why, when I try to send or to send an email with an attachment I get the error message "Attachment Id has wrong format"... ?

    Why, when I try to send or to send an email with an attachment I get the error message "Attachment Id has wrong format"... ?

    Hi AndyHolman,

    ·         What email program are you using?

    ·         What is the attachment file extension?

    Try to remove your automatic signature in your mail and see if it solves the problem.

    Please provide us with some information so that we can help you solve the problem.

    You can also contact you Email Service Provider (ESP) for assistance on the issue.

  • Cannot send emails via outlook express, but can receive

    can't send emails via outlook express but can receive.

    Get following error message

    The message could not be sent because the server rejected the sender's e-mail address. "The sender's e-mail address was..., Server:...', Protocol: SMTP, server response: ' 451 4.3.2 Please try again later ', Port: 25, secure (SSL): no, Server error: 451, error number: 0x800CCC78

    It is only to start.

    My email [email protected] mail.optusnet.com.au Server address

    Took the floor to the supplier (Optusnet) & they say it's a problem to microsoft

    And this is your address which is rejected, correct? This happens if you try to send a message to yourself?

    My money is on a server problem that will clear up on its own, but you can try a few things to eliminate that he's on your side.

    1: Disable the analysis in your e-mail anti-virus program.  It is a redundant layer of protection that devours the CPUs, slows down sending and receiving and causes a multitude of problems such as time-outs, account setting changes and has even been responsible for the loss of messages. Your up-to-date A / V program will continue to protect you sufficiently. For more information, see:
    http://www.oehelp.com/OETips.aspx#3

    Why you don't need your anti-virus to scan your email
    http://thundercloud.NET/infoave/tutorials/email-scanning/index.htm

    Note that for many AV programs, it may be necessary to uninstall the program and reinstall in custom Mode and uncheck e-mail scanning when the option is available.

    2: Create a new sent items and Outbox.

    Spend most of your messages out of the Inbox and then create new folders to send and sent items box after having moved the messages you want to save to a local folder that you create.

    Tools | Options | Maintenance | Store folder will reveal the location of your Outlook Express files. Note the location and navigate on it in Explorer Windows or, copy and paste in start | Run.

    In Windows XP, Win2K & Win2K3 the OE user files (DBX and WAB) are by default marked as hidden. To view these files in Windows Explorer, you must enable Show hidden files and folders under start | Control Panel | Folder Options icon | Opinion, or in Windows Explorer. Tools | Folder options | View.

    With OE closed, find the DBX files for the items in the Outbox and sent and delete them.  New ones will be created automatically when you open OE.

    After you're done, followed by compacting your folders manually while working * off * and do it often.

    Click Outlook Express at the top of the the folder tree so no folders are open. Then: File | Work offline (or double-click on work online in the status bar). File | Folder | Compact all folders. Don't touch anything until the compacting is completed.

    General precautions for Outlook Express:

    Do not archive mail in the receipt or sent items box. Create your own user-defined folders and move messages you want to put in them. Empty the deleted items folder daily. Although the dbx files have a theoretical capacity of 2 GB, I recommend all a 300 MB max for less risk of corruption.

    Information on the maximum size of the .dbx files that are used by Outlook Express
    http://support.Microsoft.com/?kbid=903095

    Bruce Hagen
    MS - MVP October 1, 2004 ~ September 30, 2010
    Imperial Beach, CA

  • I don't know if I'm connected to POP3, IMAP, or SMTP that I can't send emails via hotmail or send pictures.

    I don't know if I have and or connected to POP3, IMAP or SMTP that I cannot send emails via Hotmail, and can not send photos through the Windows Gallery >

    Hello

    I'm sorry, but we cannot help with hotmail problems in these forums in response to vista

    Please repost your question in hotmail in the hotmail link below forums

    http://windowslivehelp.com/product.aspx?ProductID=1

    Forums
     
     
    Consult with Microsoft Certified Solutions
     
     
    __________________________________________________________________________
     
    and read this

    you need to configure your e-mail account windows mail with your ISP internet service provider

    They provide you with account settings you need to do

    Ask them to

    username
    password for your access broadband account / distance with them

    Server of incoming POP3 mail
    outgoing mail SMTP server

    and here's how to configure windows mail after getting the email correct account settings

    http://www.vista4beginners.com/Windows-Mail

  • I can't send emails or Photos. I'm getting error 4202 for Hotmail and error OX800CCCOE for Live Mail and photo gallery

    I can't send emails or Photos.  I'm getting error 4202 for Hotmail and error OX800CCCOE for Live Mail and photo gallery

    Hello Natou41,

    The best place to ask your question of Windows Live is inside Windows Live help forums. Experts specialize in all things, Windows Live, and would be delighted to help you with your questions. Please choose a product below to be redirected to the appropriate community:

     

    Windows Live Mail

    Windows Live Hotmail

    Windows Live Messenger

    Looking for a different product to Windows Live? Visit the home page Windows Live Help for the complete list of Windows Live forums to www.windowslivehelp.com.

  • If I try and open an email with an attachment I get an error message: this file does not have a program associated with it for performing this action.

    If I try and open an email with an attachment I get an error message: this file does not have a program associated with it for performing this action. create an association in the folders option control panel.  Once there, I don't know where to go

    What is the attachment file extension? If you know what program should open with, just do the following.
     
    1. download and save the attachment to the office.
    2. right click on the saved file.
    3. Select: Open with on the shortcut menu.
    4. click on: choose [default] program.
    5. Select: The appropriate program.
    6. check: always use the selected program to open this type of file.
    7. click on OK.
     
    This should allow you to open these attachments directly from email address now.
  • Unable to send email with an attachment jpg

    Beat to death the MSNewsgroups without solution.  I have 2 comps which can send an email with an attachment jpg.  Attch no message is sent.  Message appears in the box shipping, then sent.

    Changed identity and a few other things - no joy.  Any thoughts would be appreciated.  WinXP SP3, OE6 connect via ISP

    Dave

    It looks like your ISP.  I would check with them on this subject as well.
     
    If its in sent items, then something downstream from your computer is to eat.
     
    Steve
     
    "Sabre Dave" wrote in message News: e4bdeaf2-6bac-4b7b-8e04-a30573e2e8e7...

    Send me - don't you

    Does not appear on the server webmail

    Changed identity - in fact twice, book imported & messages no problem - deleted all the rest

    Think I went through the past OE repair kit, but I'll check again and post back.

    D

  • I can't send emails via Windows mail.

    Windows Mail

    summer on the pair with verizon
    CX sahrea verizon share a rough count the i tried to sent soemthing ut keepts asking cx username and password recently bopught a new cellphone somene had helped with parameters
    cxcannot send emails
    winvistahomepremcx use win mail and mail electronic thattried to send his dead end @ the Outbox and says now
    its place there

    There are problems with Windows Mail in Vista.   You need to make sure that the antivirus software does not WinMail.  See www.oehelp.com/OETips.aspx#3 .

    Once you do this, then try to go to the Outbox and delete the messages there.  If you can't, close WinMail and use my Windows Mail utility to compact and repair the database and clear the Outbox (www.oehelp.com/WMUtil/).  Then delete your e-mail account, close and reopen WinMail and then add your account to e-mail back again.  If it is a POP3 e-mail account and you have access to multiple devices, then you should go to tools | Accounts | Mail | Properties | Advanced and set to leave a copy of messages on the server (so other devices can access the messages) and set then remove them after a certain number of days, so they don't accumulate and clog the Inbox on the server.

    Steve

  • How to send email with an attachment in Groovy?

    I have a user that is running remotely a groovy script to extract data from the Foglight Server.   When it executes this script, it has the ability to create a data file on the Foglight Server.  I would like to add a feature where this data file is sent to him and others.

    So far, I have this:

    email = new com.quest.nitro.service.sl.interfaces.email.EmailRequest ();

    email.setRecipients (containers);

    email.setSubject (subject);

    email.setBody (body);

    Server.get("EmailService").sendmail (email);

    I looked at the documentation of the API and see setAttachment() method, but I don't know how to use it.  Could you please show a sample of how to send an email with an attachment (data file is a pure text file) using Groovy?

    Thank you.

    Hi Fred -.

    Here's an example code that I have work. It should be suitable for files that are not too large:

    /***************************

    request.setBody ("Message body");

    request.setSubject ("subject line");

    request.setRecipients ("[email protected]");

    text file you want to send as an attachment

    FileInputStream fis = new FileInputStream("C:/textfile.txt");

    buffer of bytes to hold the attachment - to ensure that its larger than the size of the file

    Byte [] b = new ubyte [30000];

    read the bytes of the fileinputstream, stuff on the accessory to set the mime type and give

    Enter a file name for the e-mail client to use

    FIS. Read (b);

    request.setAttachment (b);

    request.setAttachmentMimeType("text/plain");

    request.setFileName ("emailAttachmentFile.txt");

    ready to go!

    emailService.sendMail (request);

    ********************************/

    I hope this helps.

    Robert

  • Messaging cannot send email via gmails

    All of a sudden I can't send emails using gmail accounts but normally receive emails and all emails sit in the Outbox.  With other messaging portals, such as outlook, yahoo, etc., they work very well.  Can someone Advisor to diagnose the problem.  Thank you!

    Open connection doctor in Mail and verify that the server is OK.

    Open the Mail preferences and Accounts tab select the account Gmail and account information tab, verify that you have the correct SMTP in the area. If so, disable the account, and then turn it back on. Test again and see if it works.

    If it still does not work, turn off the new account. Open Keychain preferences and delete the passwords for the gmail server. Return to the Mall and re - activate the account and test.

    If all else fails, delete the account. Open Internet accounts in system preferences and make sure that the account has been removed. Add the account back and test.

  • Unable to send email via Fastmail imap from windows mail on vista

    I can't send emails with Fastmail imap from windows mail on vista.  I can receive mail okay, but cannot send.

    Help

    Lawrence Quinny

    E-mail address is removed from the privacy *.

    See here for the correct settings: https://www.fastmail.fm/help/remote_email_access_server_names_and_ports.html

    Note that it is said that if you have a guest account, you can not send.

    Steve

  • I can't send emails via Windows Live Mail 2011. IT indicates an error 500 ox800ccc62

    Whenever I try to reply to the various emails, he indicated that there is an error 500 ox800ccc62 500 error DNS response, the NX FIELD and non-existent server. I beieve this has to do with Outlook.

    What I do need to update anything because of the new version of Windows Live Mail 2011?

    Please help me solve this problem via my hotmail account: * e-mail address is removed from the privacy *.

    Thank you,

    CLO Letendre

    Submit all Live and Hotmail queries on the forum right here:

    Windows Live Solution Center
    http://windowslivehelp.com/

  • Cannot send emails via Windows Live Mail

    When sending emails, I get an error message saying: the photos can not be found and will not be sent. I want to continue? If only the photos are not sent even if I can see them in my window from my email. Is there a solution for this.

    Original title: email forwarding

    Hello Bill,

    I suggest you to send your application in the Windows Live Mail Forums

    Concerning

  • Can send emails, but cannot receive the get Mail error ID: 0x8DE00002

    Original title: Windows Live mail

    First timer. Windows Live mail. I can send emails but cannot receive them. The following error occurs;

    Can't send or receive messages on behalf of Hotmail.co (rosspriory).

    Server error: 4402
    Server: 'https://mail.services.live.com/DeltaSync_v2.0.0/Sync.aspx '.
    Windows Live Mail error ID: 0x8DE00002

    Unlike what the error message says, I can send emails. Only, I don't get all using Windows Live mail

    I can access the web version and it sends and receives e-mail messages. But I find the flaky web version, to say the least.

    My only problem is how to find my way in this forum?

    Do not laugh!

    Server error: 4402

    This error is often associated with folders created by the user. I seem to remember that a user facing this error discovered that he had reached the upper limit on the number of files. Is this possible? There is a maximum number of folders created by the user regardless of the nesting level, and I think it's 128. Otherwise, check that the files that you see in Windows Live Mail are identical to those that you see at http://mail.live.com. If you have recently added a folder, empty it by moving its contents into a folder under storage folders, and then remove it.

    The program log shows where the error arises. Registration is enabled on the page of Maintenance program options, you can get to by pressing Ctrl-Shift-O for Options when displaying your message list. You will see the button of the Maintenance on the Advanced tab and logging for the different modes is selected at the bottom of the page. The newspaper itself, it's a text file called WindowsLiveMail.log and he lives in the root of your storage folder. The location of this folder is given under the storage folder on the same maintenance page.

    You will later need to remove Windows Live Mail account, and then add it again back to restore the synchronization between the client and server relationship. Because this may involve a lot of re - download messages, this is the last resort. He might have to wait until your account has been reset to the level of the server, which would require the intercession of a support worker. Let's try the less memorable potential remedies first.

    I don't think that repair or uninstall and reinstall the program will have any effect on this server error.

Maybe you are looking for

  • I can't upgrade to watch OS 3

    I followed all the instructions on the Update software on your Apple Watch - Apple Support, but I always get the message "the 2.2.1 version is up-to-date. What to do?

  • Fees and the QFE files install on Satellite A660

    A660. I plan to do a new installation if winows pro 7 64 on my machine of retail disk. In the folder driovers of toshiba, I see some files as files QFE-do I need? or is windows update install? Also is there a way tp preserve the thing of recovery tos

  • Replacement of FS105 with GS108

    Hello I'm new and have been looking for an answer online, but fails. I need additional network ports in my living room and my FS105 5 port box is replaced by a new GS108 8 port box. I'm online with 3800hgv-b AT & T uverse router/modem. I had a work p

  • Contacts keep "hiding" themselves?

    Pretty happy of my Defy phone other than a nagging question. Every day, I have about 20 or 30 of my contacts who will "hide" themselves. I scroll through my contacts and see some are missing. Then I'll go to contacts, menu, hide/show, and then select

  • X 220 compatible msata ssd

    Hi guys,. I've already walked by boards and couldn't find an answer updated on this topic so I was wondering if someone could clarify if the range of SSD from Samsung Evo mSata would be compatible with the X 220. The only results I found which is cru