Sender e-mail Invalid

I continue to get "Sender E-mail Invalid" when trying to send or forward messages. I have read some of the discussions but have not seen a clear cut answer or resolution. Can someone please provide a solution.

I have this issue due to using Roadrunner email. Roadrunner's SMTP server will only work when on their network. Perhaps your situation is similar.
I've tried just about everything and the best solution I've come up with is to go into email account settings and TURN OFF the Primary SMTP server (Roadrunner) when NOT on my home WiFi. By doing so, the AT&T SMTP server [cwmx.com] will then be used to send email (just need to be sure it is listed under "Other SMTP Servers"). Then when using my home WiFi again, I must go into settings and turn the Primary SMTP server (Roadrunner) ON.
It's a little cumbersome and I would welcome a better method, although I should probably just migrate to a more iPhone-friendly email system.

Similar Messages

  • Mail problem - "Sender address was invalid"

    So I get this message from time to time: then I try to send an e-mail from the mail app on my iPod Touch, it'll come back to me saying "The Sender Address was invalid" and won't send it. However, it's gotten worse of late; previously, I would hit the refresh button and then it would send, but recently that has stopped working. For about 45 minutes this morning I tried to send an e-mail and it just wouldn't send. I ended up having to log into my e-mail manually (through Safari on my iPod) to get it to send (which worked). However, I would like to know if anyone else has encountered this problem, if anyone knows what causes it, if anyone knows how to solve it, and if it would be worthwhile submitting a bug report to Apple about this. Thanks.

    With so many threads and indy websites posting this problem, I'm not sure where's best to post my solution. So it's here and I hope someone gets help from it.
    Same thing - "sender address blah blah blah" and none of the fixes worked. So I deleted the outgoing server (or so I thought!) and restarted the iPod. The server was not listed.
    Then I reentered the information and used Port 25 (I had tried that before but went back to the default port of 587 before deleting the old server).
    I connected to my WiFi and my mail went thru immediately. But what was interesting was the 'old' server showed up as the backup with port 587. I don't dare touch a thing - it's working!
    BTW, I am using my own website and mail servers (hosted elsewhere).
    Interestingly, if the iPod is accessing the mail servers, the computer access is blocked. Probably my host no allowing multiple connections from the same location, but I've done that before with my laptop and other Macs here w/o a hitch. But really a big deal, but interesting.
    Thanks to all who have posted in this thread and all the other threads. Together, we ARE tech support! But the Apple guys and gals are great as well. And this iPod Touch is AMAZING!

  • E-mail error:  Cannot Send Mail:  The sender address was invalid

    I can receive e-mail but cannot send it. Everything goes to my outbox. I did not change any settings. Nothing has changed that I know of. For months I could send e-mail -- now I cannot. I even e-mailed myself, and it says the sender address is invalid. Can anyone help? Thanks!

    The "Recipient addresses are invalid" message is misleading.
    Most ISP's don't allow you to send email through their SMTP server unless you are A) on their network (e.g. connected via wi-fi to a cable connection provided by your ISP) or B) you authenticate to their SMTP server.
    On Blueyonder here in the UK (my ISP), you can send via their SMTP server from the iPhone over 3G as long as you authenticate to it. I setup my Mac mail to authenticate on outbound email sent via smtp.blueyonder.co.uk and it works fine. I then synced the mail settings to my iPhone and it works fine (although a little slow to send).
    Alternatively your cellular provider usually runs their own SMTP server to which you will also have to authenticate, and you can send through it. For the iPhone in the UK O2 are the exclusive provider, and they have the smtp.02.co.uk gateway.

  • My 3GS will not send e-mails from yahoo. Keeps saying the username or password is invalid. How can I fix this?

    Any idea how I get fix my iphone so it will send e-mails from yahoo? It keeps saying username or password invalid. I can receive e-mails without any problem. I have tried deleting the account and reinstalling it, chek the username and password and they are correct. Went under outgoing server but it is grayed out and won't allow me to edit and add the optional username or password or anything in that section. Please help.

    First, try a system reset.  It cures many ills and it's quick, easy and harmless...
    Hold down the on/off switch and the Home button simultaneously until the screen blacks out or you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.
    If the Reset doesn't work, try a Restore.  Note that it's nowhere near as quick as a Reset.  Connect via cable to the computer that you use for sync.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.  Again, say "yes."
    Finally, if the Restore doesn't work, let the battery drain completely.  Then recharge for at least an hour and Restore again.

  • Outgoing mail unable to send "senders address invalid" how do I fix it?

    I cannot send any mail from my icqmail /(aol ) accout. Every time I try to send mail it comes up 'senders address invalid'. Which I know it's not, but I can send mail trough my hotmail accout. I have my icqmail accout as default accout which is my main accout I need to be able to send emails! Help!

    Hi..I am lucky, the Apple Store is right near me so I went to Genius Bar for help, we completey cleared out and reset my email accounts, AOL and .mac...basically started from scratch and let leopard set it up and then mail worked....However, then synching with my IPhone, I could not delete mail from my mail account...somehow some of the old server names were still there..so went in and deleted those.... and changed the setting save deleted mail on server to "no" and that solved it......
    So my AOL in the Mail application is now working but I cannot attach in AOL..Called AOL and that seems to be a problem they are working on....

  • Cannot send e-mail - "The sender address invalid" error message

    Today I keep getting this error message "The sender address is invalid - when i try to send e-mail. I checked my settings and they are the same as always - my e-mail address hasn't changed; the outgoing and incoming server information is the same. I went through the Troubleshooting steps and still nothing. Also it's taking a really long time to connect to check for incoming e-mails. Any clues on why this is happening or what I should try next? The e-mail is via Roadrunner does that matter (althoug it didn't a couple of days ago)

    This message means that your outgoing email server is not letting you connect to send email. Maybe RR changed their policy. You should be able to send using home WiFi, but when using 3G RR will not allow connections from outside their network.
    One easy way around this, is to use the built-in AT&T SMTP server for outgoing email.
    Or, check the RR FAQs and see if they allow an authenticated account to send email - maybe you just need to add SSL and username/pwd on the RR outgoing email server settings.
    BTW - this is asked almost daily - the "Search Discussions" box to your right would have given you many hits with the same answer.

  • IPhone 3G Cannot Send Mail.  The sender address was invalid.

    All of a sudden, I cannot send mail. I get the message "Cannot Send Mail" The sender address was invalid.
    I have reset the phone in hopes of resolving the problem. That did not work.
    The mail that I'm sending to IS a valid address; I'm trying to RESPOND.
    Please help.

    The configuration and use of any outgoing server address (SMTP) may not be supported due to several factors including, but not limited to, the inability for the outgoing server (SMTP) to authenticate users (whether by IP or username/password) that are not directly connected to that Internet Service Providers(ISPs) network.
    This is usually your HOME wi-fi and you are not connected to it because you are on your iPhone away from the house. This is mainly done to prevent unsolicited users from sending SPAM via the ISP's servers.
    An alternative is to use ATT SMTP Server (for US) when you are on the 3G or data network for the carrier and not on your home wi-fi. So enable ATT SMTP server under Other SMTP servers under your Mail's account settings on the iPhone.
    If you are interested you can obtain that information directly from the email provider. This article has a great temple that you can use to ask all necessary information from the provider including "If you use your ISP’s own email service (instead of a third-party such as Gmail), sometimes it may not work if you use another Internet access point, such as a cafe with wireless Internet. Ask your email provider if the settings they give you will work on other networks."
    What to ask if you're having issues sending, receiving, or configuring Mail
    http://support.apple.com/kb/HT1277

  • "Sender Name is Invalid" (can't send email from POP account) iPhone 2.1

    I updated from V2.0.2 to V2.1 today. I also swapped out my original iPhone EDGE for a new iPhone EDGE due to unrelated problems with the speaker.
    Upon testing things after restoring from backup to the new phone I discovered that I could no longer SEND email from my POP account. I could receive email just fine on that account. Sending and receiving email on my MobilMe account also worked, as did sending and receiving email via the POP account while on the Mac computer I use to sync with this iPhone.
    After digging into this with AppleCare we discovered that somehow the Port Address for the Outgoing Mail Server for that POP account had been changed from 25 to 587 on the iPhone.
    Changing it back to 25 fixed my problem.
    We don't know whether the problem was due to the 2.1 upgrade or due to something in the restore process after swapping the phones.
    If you get the error message "Sender Name is Invalid" while trying to send email from a POP account on your iPhone, go to Settings > Mail, Contacts, Calendars and select the line for your POP account.
    Now scroll down to the Outgoing Mail Server entry which should show "SMTP" and the name of the outgoing mail server for that POP account. Select that line. This will display a list of servers with your POP account server showing at the top as the Primary Server. Select that line.
    In the panel that displays, check the Server Port. If it is something odd like 587, that may be your problem. Select the line and you can edit it to something more normal like 25. Touch the "SMTP" button at the top left of the number entry screen to accept that new value.
    We discovered that after correcting that value on the iPhone it STAYS corrected even after doing a new Sync with iTunes, or after MobileMe syncs.
    --Bob

    Sorry you had problems Bob.
    Depending on the mail service you are using, Port 25 or Port 587 are usually acceptable for outgoing
    SMTP mail. Many cafes will block the customary port 25 to prevent spammers from using their
    wireless access.
    There is a superb tutorial posted here:
    http://www.webmail.us/docs/support/Macintosh-OSX-Mail.pdf
    Also be sure for each mail account to turn ON the secondary AT&T server shown at the bottom
    of the SMTP server list for each account -- it will make your transition from wireless to Edge
    to 3G networks much more reliable.
    Thanks for sharing what you've learned. Hope this helps.

  • Can't send e-mails to personal e-mail account outside the company

    Hello
    I'm trying to use UTL_SMTP package to send e-mails to users either by pressing a button, or deployed by a trigger. I'm using procedure Send_mail to do it but encountered a problem:
    if it's a company e-mail address, it works fine - although i haven't been able to put more than 2 recipients at the same time (ORA-29279: SMTP permanent error: 501 5.1.3 Invalid address). if it's a personal account, it returns error ORA-29278: SMTP transient error: 421 Service not available.
    At this point, procedure's parameters are all static.
    I've tried using procedure Send of UTL_MAIL package but, having also static parameters, when sending to a personal account outside the company it also returns error ORA-29278.
    What am i doing wrong?
    Many thanks for your replies!

    I forgot to pass port 26 as a parameter in UTL_SMTP package.

  • Send test mail not working in content server 11g(UCM)

    Hi all ,
    I am using content server 11g and i have installed all the components required for email and also i had made all the internet configuration in (admin server -> internet configuration) according to my company mail server.
    But while sending test mail from the administration panel i am getting the following error::-
    Unable to send email. Could not send mail message from [email protected] with subject line: test mail. Invalid mail message: "xyz" <[email protected]> "Unable to find one or more recipients of message." Mail server responded with error message: 554 5.7.1 <[email protected]>: Sender address rejected: Access denied
    the associated log file is ::
    !csSMTPInvalidMessage,[email protected]!csSMTPResponseIndicatesFailure,554 5.7.1 <[email protected]>: Sender address rejected: Access denied
    java.lang.Exception: !csSMTPResponseIndicatesFailure,554 5.7.1 <[email protected]>: Sender address rejected: Access denied
         at intradoc.common.SmtpClient.writeMsg(SmtpClient.java:531)
         at intradoc.common.SmtpClient.writeMultiMsg(SmtpClient.java:555)
         at intradoc.common.SmtpClient.sendMail(SmtpClient.java:337)
         at intradoc.server.InternetFunctions.sendMail(InternetFunctions.java:440)
         at intradoc.server.InternetFunctions.sendMailToEx(InternetFunctions.java:358)
         at intradoc.server.InternetFunctions.sendMailTo(InternetFunctions.java:83)
         at intradoc.server.InternetFunctions.sendMailPackage(InternetFunctions.java:719)
         at intradoc.server.InternetFunctions$1.run(InternetFunctions.java:624)
         at java.lang.Thread.run(Thread.java:662)
    Please reply!!!
    Edited by: user13475326 on Dec 14, 2010 2:27 AM

    WHo is administering your mail server?
    They have obvioulsy placed some restrictions on the server to stop it being abused.
    First try using a real valid email address for the Administrator address for the network. Otherwise speak to the sys admin for your SMTP/mail infrastructure and see what needs toi be done.
    Tim

  • To send the mail

    Hi,
    I have applied this in the 10g Oracle express database without any problem
    CREATE OR REPLACE PROCEDURE schema2.send_mail (
    p_mail_host IN VARCHAR2,
    p_from IN VARCHAR2,
    p_to IN VARCHAR2,
    p_subject IN VARCHAR2,
    p_message IN VARCHAR2)
    AS
    l_mail_conn UTL_SMTP.connection;
    BEGIN
    l_mail_conn := UTL_SMTP.open_connection(p_mail_host, 25);
    UTL_SMTP.helo(l_mail_conn, p_mail_host);
    UTL_SMTP.mail(l_mail_conn, p_from);
    UTL_SMTP.rcpt(l_mail_conn, p_to);
    UTL_SMTP.open_data(l_mail_conn);
    UTL_SMTP.write_data(l_mail_conn, 'Date: ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS') || Chr(13));
    UTL_SMTP.write_data(l_mail_conn, 'From: ' || p_from || Chr(13));
    UTL_SMTP.write_data(l_mail_conn, 'Subject: ' || p_subject || Chr(13));
    UTL_SMTP.write_data(l_mail_conn, 'To: ' || p_to || Chr(13));
    UTL_SMTP.write_data(l_mail_conn, '' || Chr(13));
    UTL_SMTP.write_data(l_mail_conn, p_message || Chr(13));
    UTL_SMTP.close_data(l_mail_conn);
    UTL_SMTP.quit(l_mail_conn);
    END send_mail;
    SHOW ERRORS
    Then I try to send one mail like this
    DECLARE
    vSender VARCHAR2(100) := 'postmaster@mysmtpdomain';
    vRecip VARCHAR2(30) := '[email protected]';
    vSubj VARCHAR2(50) := 'testing mail';
    vMesg VARCHAR2(4000) := 'I''m to check the smtp is working fine';
    vMType VARCHAR2(30) := 'text/plain; charset=us-ascii';
    BEGIN
    schema2.send_mail('mysmtpdomain', vSender, vRecip, vSubj, vMesg);
    END;
    but I can't receive the mail! Any advice?
    Best regards
    Edited by: HuaMin Chen on May 26, 2011 4:18 PM

    I still have got these (no improvements)
    17:31:48 SQL> create or replace procedure send_mail_nw
    17:31:54 2 IS
    17:31:54 3 mailhost VARCHAR2(30) := '10.?.5.?';
    17:31:54 4 mail_conn utl_smtp.connection;
    17:31:54 5 crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
    17:31:54 6 mesg VARCHAR2( 1000 );
    17:31:54 7 BEGIN
    17:31:54 8 mail_conn := utl_smtp.open_connection('10.?.5.?', 25);
    17:31:54 9 mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf ||
    17:31:54 10 'From: <postmaster@mysmtpdomain'||'>' || crlf ||
    17:31:54 11 'Subject: '||''testing mail' || crlf ||
    17:31:54 12 'To: '||'[email protected]'|| crlf ||
    17:31:54 13 '' || crlf || 'Testing mail procedure';
    17:31:54 14 utl_smtp.helo(mail_conn, '10.?.100.?');
    17:31:54 15 utl_smtp.mail(mail_conn, 'postmaster@mysmtpdomain');
    17:31:54 16 utl_smtp.rcpt(mail_conn, '[email protected]');
    17:31:54 17 utl_smtp.data(mail_conn, 'Testing mail procedure');
    17:31:54 18 utl_smtp.quit(mail_conn);
    17:31:54 19 END;
    17:31:54 20 /
    ERROR:
    ORA-24450: Cannot pre-process OCI statement
    17:31:54 SQL> show errors
    Errors for PROCEDURE SEND_MAIL_NW:
    LINE/COL ERROR
    10/10 PLS-00103: Encountered the symbol "POSTMASTER" when expecting one
    of the following:
    * & = - + ; < / > at in is mod remainder not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
    LIKE4_ LIKEC_ between || member SUBMULTISET_
    The symbol "*" was substituted for "POSTMASTER" to continue.
    10/45 PLS-00103: Encountered the symbol "||" when expecting one of the
    following:
    . ( * @ & = - + ; < / > at in is mod remainder not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
    LIKE4_ LIKEC_ between || member SUBMULTISET_
    17:31:54 SQL>
    17:31:54 SQL> exec send_mail_nw
    BEGIN send_mail_nw; END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00905: object SCHEMA2.SEND_MAIL_NW is invalid
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

  • How I fixed the "can't send e-mail after upgrade to 10.5.6" problem

    Like many of you I couldn't send e-mail after the upgrade. After trying everything including re-install combo update, delete and resetting profile, etc. the thing that made it work was:
    1. custom set the outgoing server port number to 25 (for Verizon, ask your ISP the output port number)
    2. ensure the password authentication is set for outgoing e-mail.
    Goto account setting, "Outgoing Mail Server (SMTP)", select "Edit Server list"
    Under "Account Information" make sure "Description" is blank (as suggested in other posts)
    Under "Advance Information", select Use Custom Port: type in the port number
    On Authentication, select password, type in user name and password as in "incoming Mail Server"
    Save it and test if it works.
    It seems selection of the default outgoing port has some problems, even though 15 is one of the three defaults.
    Scott

    I just switched to Roadrunner and am having the same "can't send email" problem. I have done what you suggested, but the problem persists. I did note that in my outgoing mail server box it says: smtp-server.wi.rr.com:jzelinger3 (Offline). I'm not sure where the "Offline" is coming from or why it is there. Any suggestions? I performed the following Terminal tests with a tech. support person from Roadrunner:
    Last login: Wed Jan 21 19:36:52 on console
    CPE-75-86-226-41:~ joan$ telnet pop-server.wi.rr.com 110
    Trying 71.74.56.78...
    Connected to pop-server.wi.rr.com.
    Escape character is '^]'.
    +OK POP3 server ready.
    user [email protected]
    +OK please send PASS command
    pass laikatess
    +OK [email protected] is welcome here
    telnet smtp-server.wi.rr.com 25
    -ERR Invalid command; valid commands: CAPA, DELE, LIST, LAST, NOOP, RETR, RSET, STAT, TOP, UIDL or QUIT
    This is very frustrating.
    J. A. Zelinger

  • Sending Confirm mail

    hi,
    I am using servlets to send a mail to a user using java mail
    and this is my code
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    import java.io.*;
    import java.net.*;
    public class SendMailServlet extends HttpServlet
         PrintWriter out;
         String smtpServer;
         public void init(ServletConfig config) throws ServletException
              try
                   super.init(config);
                   smtpServer =config.getInitParameter("mail.rediffmail.com");
                   System.out.println(smtpServer);
              catch(Exception e)
                   System.out.println("Inside init()" + e);
         public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
              try
              res.setContentType("text/html");
              String from = req.getParameter("from");
              String to = req.getParameter("to");
              String subject = req.getParameter("subject");
              String text = req.getParameter("text");
              System.out.println(from);
              System.out.println(to);
              System.out.println(subject);
              System.out.println(text);
                   out = res.getWriter();
                   Properties properties = System.getProperties();
                   properties.put("mail.smtp.host","smtp.rediffmail.com");
                   Session session = Session.getInstance(properties, null);
                   System.out.println("Session " + session);
                   MimeMessage message = new MimeMessage(session);
                   Address fromAddress = new InternetAddress(from);
                   message.setFrom(fromAddress);
                   if (to != null)
                        Address[] toAddress = InternetAddress.parse(to);
                        message.setRecipients(Message.RecipientType.TO, toAddress);
                   message.setSubject(subject);
                   message.setText(text);
                   Transport.send(message);
                   out.println("Message sent successfully.");
              catch (Exception e)
                   out.println("Invalid e-mail address.<br>" + e.getMessage());
    when i use this i am getting an error as
    Invalid e-mail address.
    Sending failed; nested exception is: javax.mail.MessagingException: Unknown SMTP host: smtp.rediffmail.com; nested exception is: java.net.UnknownHostException: smtp.rediffmail.com
    Please help

    Hi,
    This is quite simple, probably there is no server called smtp.rediffmail.com. Use 'nslookup' to find out the ip of @rediffmail.com. One more thing , if you try to use rediff servers to send mails to non-rediff ids, it will be considered as a spam. In practice you cannot do that, rediff will reject your request.
    cheers
    Projyal

  • Problems sending a mail!

    I have a SMTP server and I have this code to send a mail
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class MailExample {
      public static void main (String args[]) throws Exception {
        String host = "localhost";
        String from = "[email protected]";
        String to = "[email protected]";
        // Get system properties
        Properties props = System.getProperties();
        // Setup mail server
        props.put("mail.smtp.host", host);
        // Get session
        Session session = Session.getDefaultInstance(props, null);
        // Define message
        MimeMessage message = new MimeMessage(session);
        // Set the from address
        message.setFrom(new InternetAddress(from));
        // Set the to address
        message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
        // Set the subject
        message.setSubject("Hello JavaMail");
        // Set the content
        message.setText("Welcome to JavaMail");
        // Send message
        Transport.send(message);
    }and sometimes I can send emails, but after sending some emails(max 10) I get to the same email adresses that I use the error invalid recipient. Does anyone know why this is happening?
    Could the server have limited mail number that I can send?

    and sometimes I can send emails, but after sending
    some emails(max 10) I get to the same email adresses
    that I use the error invalid recipient. Does anyone
    know why this is happening?
    Could the server have limited mail number that I can
    send?Hi,
    your code seems to be just perfect. There is definitely something wrong with the SMTP server configuration. Maybe this server has something like anti-flooding system enabled or has sort of messages-per-minute limit?
    best wishes
    Piotr Maj
    jcake software - http://jcake.com
    jcake-mx - easy email sending in Java

  • Sending e-mail prior to Ora 8.0 from PL/SQL

    Dear peers,
    I would like to e-mail from a Pl/SQL block but can't use utl_smtp because the Oracle version is prior to 8.0. Could you recommend ways of doing so?
    My OS is Unix and have Perl,and PHP as well. I have little experience with any of this tools, so please be simple.
    Any suggestions would be greatly appreciated.
    Thanks, CIP

    Hi,
    The following article on sending mail is for Oracle 7.x as well and is specific to UNIX. It uses DBMS_PIPE PL/SQL package, a PRO*C program and UNIX sendmail utility for sending e-mail. For this, the database you are using should have DBMS_PIPE package installed.
    Hope that helps,
    Srinivas
    ARTICLE : How to Generate E-mail within PL/SQL Routines?
    References
    For DBMS_PIPE/architecture, refer to the following:
    "Oracle7 Server Application Developer's Guide" (A32536-1)
    "Oracle8 Application Developer's Guide Release 8.0" (A58241-01)
    "Oracle8i Supplied PL/SQL Packages Reference Release 2 (8.1.6)" (A76936-01)
    Preparation
    Perform the steps below to setup the necessary files.
    Note: When testing on your machine, the code generates simple
    e-mail messages for demonstration purposes.
    1. Read the main comment block of maildaemon.pc and make appropriate
    changes.
    2. Read the main comment block of maildaemon.sql and make appropriate
    changes.
    3. Connect to SQL*Plus. If not already setup, GRANT EXECUTE ON DBMS_PIPE TO
    where userid is public or the schema owner of the package.
    4. Run maildaemon.sql to setup dependencies.
    5. Copy proc.mk (demo_proc.mk on v8 databases) into directory and issue
    the following make line to build the executable for maildaemon:
    make -f proc.mk build EXE=maildaemon OBJS=maildaemon.o
    PROCFLAGS="sqlcheck=semantics parse=full userid=scott/tiger"
    Note: Replace userid=scott/tiger with the schema to build under.
    6. Run the maildaemon executable.
    7. To test, modify the code below and run from SQL*Plus:
    declare
    dummy number;
    begin
    maildaemon.setauditon;
    dummy:= maildaemon.email_msg1( '[email protected]' );
    dummy:= maildaemon.email_msg2( '[email protected]', 'scott',
    to_char( sysdate, 'dd-Mon-yyyy hh:mi:ss' ));
    maildaemon.setauditoff;
    maildaemon.stop;
    end;
    maildaemon.sql
    rem file: maildaemon.sql
    rem last modified: 10/15/98
    rem
    rem This source file generates dependencies for the maildaemon executable
    rem such as logging as well as the PL/SQL package interface to communicate
    rem with the maildaemon Pro*C application.
    rem
    rem Please note: this is just a sample. You will need to modify/replace the
    rem email_msg1() and email_msg2() functions in the maildaemon package.
    rem Both functions have been provided as simple demonstrations on how to
    rem write an interface. Consult the Application Developers Guide for more
    rem information on using the DBMS_PIPE package.
    rem table: emailaudit
    rem purpose: contain auditing messages from the maildaemon Pro*C application
    create table emailaudit
    msgid number constraint msgid_pk primary key,
    msgtype varchar2( 20 ),
    msgstat varchar2( 100 )
    rem sequence: emailmsgseq
    rem purpose: to allow maildaemon Pro*C application to generate unique message
    rem identifiers for opening temporary files and auditing.
    create sequence emailmsgseq;
    rem package: maildaemon
    rem purpose: provide a PL/SQL interface to generate e-mail messages
    create or replace package maildaemon as
    /* setauditon( )
    * procedure
    * parameters: timeout: timeout factor for informing the maildaemon exe
    * exceptions: -20030: error sending message to maildaemon exe
    * description: turn on auditing in the maildaemon exe
    procedure setauditon( timeout number default 10 );
    /* setauditoff( )
    * procedure
    * parameters: timeout: timeout factor for informing the maildaemon exe
    * exceptions: -20030: error sending message to maildaemon exe
    * description: turn off auditing in the maildaemon exe
    procedure setauditoff( timeout number default 10 );
    /* stop( )
    * procedure
    * parameters: timeout: timeout factor for informing the maildaemon exe
    * exceptions: -20030: error sending message to maildaemon exe
    * description: shutdown the maildaemon exe
    procedure stop( timeout number default 10 );
    /* email_msg1( )
    * function
    * parameters: emailaddr: email address to send email to
    * timeout: timeout factor for informing the maildaemon exe
    * returns: return code from mail daemon call
    * exceptions: -20010: maildaemon had an error during sending email
    * -20011: error during sending message to maildaemon exe
    * -20012: message returned from maildaemon other than done
    * -20013: maildaemon returned an error code other than 0
    * description: generic sample to demonstrate a simple interface to the
    * maildaemon exe
    function email_msg1( emailaddr in varchar2, timeout number default 10 ) return number;
    /* email_msg2( )
    * function
    * parameters: emailaddr: email address to send email to
    * userid: userid to place in the mail text
    * timestamp: timestamp to place in the mail text
    * timeout: timeout factor for informing the maildaemon exe
    * returns: return code from mail daemon call
    * exceptions: -20010: maildaemon had an error during sending email
    * -20011: error during sending message to maildaemon exe
    * -20012: message returned from maildaemon other than done
    * -20013: maildaemon returned an error code other than 0
    * description: generic sample to demonstrate a simple interface to the
    * maildaemon exe by passing parameters
    function email_msg2( emailaddr in varchar2, userid in varchar2, timestamp in varchar2,
    timeout number default 10 ) return number;
    end maildaemon;
    create or replace package body maildaemon as
    procedure setauditon( timeout number default 10 ) is
    retval number;
    begin
    dbms_pipe.pack_message( 'AUDIT' );
    retval := dbms_pipe.send_message( 'maildaemon', timeout );
    if retval <> 0 then
    raise_application_error( -20030,
    'maildaemon: error sending audit command. Status = ' &#0124; &#0124; retval );
    end if;
    end setauditon;
    procedure setauditoff( timeout number default 10 ) is
    retval number;
    begin
    dbms_pipe.pack_message( 'NOAUDIT' );
    retval := dbms_pipe.send_message( 'maildaemon', timeout );
    if retval <> 0 then
    raise_application_error( -20030,
    'maildaemon: error sending noaudit command. Status = ' &#0124; &#0124; retval );
    end if;
    end setauditoff;
    procedure stop( timeout number default 10 ) is
    retval number;
    begin
    dbms_pipe.pack_message( 'STOP' );
    retval := dbms_pipe.send_message( 'maildaemon', timeout );
    if retval <> 0 then
    raise_application_error( -20030,
    'maildaemon: error sending stop command. Status = ' &#0124; &#0124; retval );
    end if;
    end stop;
    function email_msg1( emailaddr in varchar2, timeout number default 10 ) return number is
    retval number;
    result varchar2(20);
    cmdcode number;
    pipenm varchar2(30);
    begin
    pipenm := dbms_pipe.unique_session_name;
    dbms_pipe.pack_message( 'MSG1' );
    dbms_pipe.pack_message( pipenm );
    dbms_pipe.pack_message( emailaddr );
    retval := dbms_pipe.send_message( 'maildaemon', timeout );
    if retval <> 0 then
    raise_application_error( -20010,
    'maildaemon: error while sending email. Status = ' &#0124; &#0124; retval );
    end if;
    retval := dbms_pipe.receive_message( pipenm, timeout );
    if retval <> 0 then
    raise_application_error( -20011,
    'maildaemon: error while receiving daemon response. Status = ' &#0124; &#0124; retval );
    end if;
    dbms_pipe.unpack_message( result );
    if result <> 'done' then
    raise_application_error( -20012,
    'maildaemon: error code returned from daemon other than done' );
    end if;
    dbms_pipe.unpack_message( cmdcode );
    if cmdcode <> 0 then
    raise_application_error( -20013,
    'maildaemon: error code returned from daemon ' &#0124; &#0124; cmdcode );
    end if;
    return cmdcode;
    end email_msg1;
    function email_msg2( emailaddr in varchar2, userid in varchar2, timestamp in varchar2,
    timeout number default 10 ) return number is
    retval number;
    result varchar2(20);
    cmdcode number;
    pipenm varchar2(30);
    begin
    pipenm := dbms_pipe.unique_session_name;
    dbms_pipe.pack_message( 'MSG2' );
    dbms_pipe.pack_message( pipenm );
    dbms_pipe.pack_message( em ailaddr );
    dbms_pipe.pack_message( userid );
    dbms_pipe.pack_message( timestamp );
    retval := dbms_pipe.send_message( 'maildaemon', timeout );
    if retval <> 0 then
    raise_application_error( -20010,
    'maildaemon: error while sending email. Status = ' &#0124; &#0124; retval );
    end if;
    retval := dbms_pipe.receive_message( pipenm, timeout );
    if retval <> 0 then
    raise_application_error( -20011,
    'maildaemon: error while receiving daemon response. Status = ' &#0124; &#0124; retval );
    end if;
    dbms_pipe.unpack_message( result );
    if result <> 'done' then
    raise_application_error( -20012,
    'maildaemon: error code returned from daemon other than done' );
    end if;
    dbms_pipe.unpack_message( cmdcode );
    if cmdcode <> 0 then
    raise_application_error( -20013,
    'maildaemon: error code returned from daemon ' &#0124; &#0124; cmdcode );
    end if;
    return cmdcode;
    end email_msg2;
    end maildaemon;
    maildaemon.pc
    * file: maildaemon.pc
    * last modified: 10/15/98
    * This source code is written for the UNIX environment to allow PL/SQL
    * to generate e-mail. Please note, the following code might not work on
    * your system due to configurations of the operating system or your
    * environment. Please consult your systems administrator for more
    * information on specifics.
    * Variables to be set prior to building:
    * mailhost: the mail application to generate email queuing. Default is
    * "/usr/lib/sendmail".
    * mailswitch: the mail application switches to pass to $mailhost. Default
    * is "-t".
    * userpass: the username/password to connect to the database. Default is
    * "scott/tiger"
    * logfile: the logfile to write system messages to.
    * Functions to be modified:
    * main( ): will need to modify the message handling portion to handle the
    * messages from the maildaemon package (PL/SQL). The changes that need
    * to be made are in the else if( ... ) portion with handling MSG1 and
    * MSG2.
    * msg1( ): this is just a stub sample. Replace this with appropriate code
    * and change the call in main( ).
    * msg2( ): this is just a stub sample. Replace this with appropriate code
    * and change the call in main( ).
    * System include files
    #include <stdio.h>
    #include <string.h>
    EXEC SQL INCLUDE sqlca;
    * Global variable declaration
    EXEC SQL BEGIN DECLARE SECTION;
    char *mailhost = "/usr/lib/sendmail";
    /* the mail host application to gen email requests */
    char *mailswitch = "-t";
    /* switches to pass to $mailhost */
    char *userpass = "scott/tiger";
    /* userid/password to connect to the database as */
    char *logfile = "maildaemon.log";
    /* log file to write messages to */
    FILE *loghnd = NULL;
    /* file pointer to log file */
    int retval;
    /* return value for DBMS_PIPE send */
    int calval;
    /* return value set from DBMS_PIPE receive */
    varchar pipeid[ 30 ];
    /* return pipe identifier */
    char filename[ 128 ];
    /* filename to use for email */
    varchar command[ 20 ];
    /* system command received from DBMS_PIPE receive */
    char syscommand[ 2000 ];
    /* hold system command for generating email request */
    varchar emailaddr[ 256 ];
    /* hold the email address for sending message to */
    int auditing= 0;
    /* set whether auditing is to be done */
    varchar string1[ 256 ];
    /* hold string 1 passed from server */
    varchar string2[ 256 ];
    /* hold string 2 passed from server */
    EXEC SQL END DECLARE SECTION;
    * Function definition
    * conerr( )
    * handle connection error
    void conerr( )
    char msgbuf[ 512 ]; /* message buffer */
    int msglen; /* message buffer space used */
    int maxmsglen; /* maximum message length */
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    sqlglm( msgbuf, &maxmsglen, &msglen );
    fprintf( loghnd, "maildaemon: error during connect to database\n" );
    fprintf( loghnd, "error reported: %.*s\n", msglen, msgbuf );
    fprintf( loghnd, "maildaemon: aborting...\n" );
    exit( 1 );
    } /* end conerr( ) */
    * sqlerr( )
    * handle general SQL error
    * does not cause maildaemon to abort
    void sqlerr( )
    char msgbuf[ 512 ]; /* message buffer */
    int msglen; /* message buffer space used */
    int maxmsglen; /* maximum message length */
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    sqlglm( msgbuf, &maxmsglen, &msglen );
    fprintf( loghnd, "maildaemon: error during processing\n" );
    fprintf( loghnd, "error reported: %.*s\n", msglen, msgbuf );
    fprintf( loghnd, "maildaemon: continuing...\n" );
    } /* end sqlerr( ) */
    * msg1( )
    * stub function example 1 for sending an email.
    int msg1( )
    EXEC SQL BEGIN DECLARE SECTION;
    int retcode = 0; /* return code */
    long msgid; /* unique message id */
    FILE msghnd = NULL; / file handle to write email file */
    EXEC SQL END DECLARE SECTION;
    if( emailaddr.len == 0 )
    { /* null address passed */
    fprintf( loghnd, "maildaemon: null address specified to msg1( )\n" );
    retcode= 999;
    return( retcode );
    } /* end if */
    /* get the next sequence number for uniqueness */
    EXEC SQL WHENEVER SQLERROR GOTO sqlerror1;
    EXEC SQL SELECT emailmsgseq.nextval INTO :msgid FROM dual;
    /* generate the filename so it is unique and open the file */
    sprintf( filename, "emailmsg.txt.%ld", msgid );
    msghnd= fopen( filename, "w" );
    if( msghnd == NULL )
    { /* there was an error opening the output file */
    retcode= 1;
    if( auditing )
    { /* set audit trail */
    EXEC SQL INSERT INTO emailaudit VALUES( :msgid, 'msg1', 'maildaemon: status code of: ' &#0124; &#0124; :retcode );
    EXEC SQL COMMIT;
    } /* end if */
    return( retcode );
    } /* end if */
    /* generate email */
    fprintf( msghnd, "To: %s\n", emailaddr.arr );
    fprintf( msghnd, "Subject: msg1 message type\n\n" );
    fprintf( msghnd, "\tmsg1 message type was called for emailing\n" );
    fprintf( msghnd, "\ngenerated by maildaemon\n" );
    /* close the file */
    fclose( msghnd );
    /* create the command line and send the message */
    sprintf( syscommand, "%s %s < %s", mailhost, mailswitch, filename );
    retcode= system( syscommand );
    /* remove the temporary file */
    unlink( filename );
    if( auditing )
    { /* set audit trail */
    EXEC SQL INSERT INTO emailaudit VALUES( :msgid, 'msg1', 'maildaemon: status code of: ' &#0124; &#0124; :retcode );
    EXEC SQL COMMIT;
    } /* end if */
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    return( retcode );
    sqlerror1:
    retcode= 1;
    sqlerr( );
    return( retcode );
    } /* end msg1( ) */
    * msg2( )
    * stub function example 2 for sending an email.
    int msg2( )
    EXEC SQL BEGIN DECLARE SECTION;
    int retcode = 0; /* return code */
    long msgid; /* unique message id */
    FILE msghnd = NULL; / file handle to write email file */
    EXEC SQL END DECLARE SECTION;
    if( emailaddr.len == 0 )
    { /* null address passed */
    fprintf( loghnd, "maildaemon: null address specified to msg2( )\n" );
    retcode= 999;
    return( retcode );
    } /* end if */
    /* get the next sequence number for uniqueness */
    EXEC SQL WHENEVER SQLERROR GOTO sqlerror2;
    EXEC SQL SELECT emailmsgseq.nextval INTO :msgid FROM dual;
    /* generate the filename so it is unique and open the file */
    sprintf( filename, "emailmsg.txt.%ld", msgid );
    msghnd= fopen( filename, "w" );
    if( msghnd == NULL )
    { /* there was an error opening the output file */
    retcode= 1;
    if( auditing )
    { /* set audit trail */
    EXEC SQL INSERT INTO emailaudit VALUES( :msgid, 'msg2', 'maild aemon: status code of: ' &#0124; &#0124; :retcode );
    EXEC SQL COMMIT;
    } /* end if */
    return( retcode );
    } /* end if */
    /* generate email */
    fprintf( msghnd, "To: %s\n", emailaddr.arr );
    fprintf( msghnd, "Subject: msg2 message type\n\n" );
    fprintf( msghnd, "\tmsg2 message type was called for emailing\n" );
    fprintf( msghnd, "Userid of user: %s\n", string1.arr );
    fprintf( msghnd, "Timestamp of transaction: %s\n", string2.arr );
    fprintf( msghnd, "\ngenerated by maildaemon\n" );
    /* close the file */
    fclose( msghnd );
    /* create the command line and send the message */
    sprintf( syscommand, "%s %s < %s", mailhost, mailswitch, filename );
    retcode= system( syscommand );
    /* remove the temporary file */
    unlink( filename );
    if( auditing )
    { /* set audit trail */
    EXEC SQL INSERT INTO emailaudit VALUES( :msgid, 'msg2', 'maildaemon: status code of: ' &#0124; &#0124; :retcode );
    EXEC SQL COMMIT;
    } /* end if */
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    return( retcode );
    sqlerror2:
    retcode= 1;
    sqlerr( );
    return( retcode );
    } /* end msg2( ) */
    void main( )
    /* open file and verify logging */
    loghnd = fopen( logfile, "a" );
    if( loghnd == NULL )
    { /* the logfile was unable to be opened */
    printf( "maildaemon: error opening logfile (%s)\n", logfile );
    exit( 1 );
    } /* end if */
    /* connect to the database */
    EXEC SQL WHENEVER SQLERROR DO conerr( );
    EXEC SQL CONNECT :userpass;
    fprintf( loghnd, "maildaemon: connected.\n" );
    /* loop until stop command given */
    EXEC SQL WHENEVER SQLERROR DO sqlerr();
    while( 1 == 1 )
    { /* inifinite loop */
    /* reset values */
    emailaddr.len = 0;
    string1.len= 0;
    string2.len = 0;
    /* get type of message from 'server' */
    EXEC SQL EXECUTE
    begin
    :calval := dbms_pipe.receive_message( 'maildaemon' );
    if :calval = 0 then
    dbms_pipe.unpack_message( :command );
    end if;
    end;
    END-EXEC;
    if( calval == 0 )
    { /* message received. determine the command */
    command.arr[ command.len ]= '\0';
    if( !strcmp(( char * ) command.arr, "STOP" ))
    { /* 'server' specified to stop */
    fprintf( loghnd, "maildaemon: shutdown in progress...\n" );
    break;
    } /* end if */
    else if( !strcmp(( char * ) command.arr, "AUDIT" ))
    { /* set auditing on */
    fprintf( loghnd, "maildaemon: enable auditing...\n" );
    auditing= 1;
    } /* end else if */
    else if( !strcmp(( char * ) command.arr, "NOAUDIT" ))
    { /* set auditing off */
    fprintf( loghnd, "maildaemon: disable auditing...\n" );
    auditing= 0;
    } /* end else if */
    else if( !strcmp(( char * ) command.arr, "MSG1" ))
    { /* call for message 1 */
    /* retrieve the message */
    EXEC SQL EXECUTE
    begin
    dbms_pipe.unpack_message( :pipeid );
    dbms_pipe.unpack_message( :emailaddr );
    end;
    END-EXEC;
    /* copy into host variable */
    emailaddr.arr[ emailaddr.len ]= '\0';
    /* generate the email */
    retval= msg1( );
    /* reply with response */
    EXEC SQL EXECUTE
    begin
    dbms_pipe.pack_message( 'done' );
    dbms_pipe.pack_message( :retval );
    :retval := dbms_pipe.send_message( :pipeid );
    end;
    END-EXEC;
    } /* end else if */
    else if( !strcmp(( char * ) command.arr, "MSG2" ))
    { /* call for message 2 */
    /* retrieve the message */
    EXEC SQL EXECUTE
    begin
    dbms_pipe.unpack_message( :pipeid );
    dbms_pipe.unpack_message( :emailaddr );
    dbms_pipe.unpack_message( :string1 );
    dbms_pipe.unpack_message( :string2 );
    end;
    END-EXEC;
    /* copy into host variable */
    emailaddr.arr[ emailaddr.len ]= '\0';
    string1.arr[ string1.len ]= '\0';
    string2.arr[ string2.len ]= '\0';
    /* generate the email */
    retval= msg2( );
    /* reply with response */
    EXEC SQL EXECUTE
    begin
    dbms_pipe.pack_message( 'done' );
    dbms_pipe.pack_message( :retval );
    :retval := dbms_pipe.send_message( :pipeid );
    end;
    END-EXEC;
    } /* end else if */
    else
    { /* invalid command received */
    fprintf( loghnd, "maildaemon: illegal command... ignoring request.\n" );
    } /* end else */
    } /* end if */
    else
    { /* time out error occured */
    fprintf( loghnd, "maildaemon: timeout or other error while waiting for signal request.\n" );
    } /* end else */
    } /* end while */
    /* clean up and exit */
    EXEC SQL COMMIT WORK RELEASE;
    fprintf( loghnd, "maildaemon: shutdown.\n" );
    fclose( loghnd );
    } /* end main( ) */
    null

Maybe you are looking for

  • Media list required for PI 7.1 including EHP1 for AIX, DB2.

    I am in the process of downloading software for PI7.1 including EHP1. But I identified below two links in service market place. Which is one is the correct link for getting combined pack of PI 7.1 including EHP1 for fresh installation? https://websmp

  • $AP_TOP/reports/US

    hello , can any one tell me about this " $AP_TOP/reports/US" actually I want to register oracle report(emp.rdf) in EBS and first step is that copy emp.rdf in "$AP_TOP/reports/US" but I don't know about $AP_TOP/reports/US so please tell me about $AP_T

  • Can't Upgrade or Uninstall Lightroom 1.0 on WinXP

    When I try to upgrade to 1.1 the installation stops about halfway through the progress bar after clicking the "Install" button... ... during "Removing applications" I am prompted with a dialog box asking for the "Use source:" "The feature you are try

  • Want to load PS Elements 9 to netbook

    I have recently bought PS Elements 9 for my home desktop computer.  I'd like to also put it on my netbook....can I do that?  If so, how?  It is on a disk and my netbook of course does not take a disk.  Thanks

  • Satelitte l745-s4210 factory restore

    my laptop won't start normally nor will it start in safe mode or run the repair utility.  i want to restore to factory but can't find the right pf key or instructions.  i have been searching for hours.  please help.  thanks Solved! Go to Solution.