[NEWSboard IBMi Forum]
  1. #1
    Registriert seit
    Jan 2009
    Beiträge
    10

    Question SMTP mails versenden mit QTMMSNDM, brauche Hile

    Liebe Lesenden,

    ich versuche gerade über das API QTMMSNDM emails an mehrere Empfänger zu versenden.
    Dafür erzeuge ich mir eine txt Datei im ifs, fülle diese mit allem Notwendigen und rufe dann das API auf.
    Das klappt auch alles wunderbar...
    Allerdings erhält nur der erste Empfänger eine email. Alle anderen nicht.
    Auch der erste CopyReceiver erhält eine email, die anderen nicht.
    Und so verhält es sich auch mit den BCC Receivern...

    Was läuft falsch???

    Technisch gesehen stehen alle Empfänger in einer großen Struktur.
    Ich gehe also davon aus, dass diese Struktur korrekt gefüllt wurde von mir, da ja ansonsten auch die CC und BCC nicht erkannt werden würden...

    Ich hoffe, es kennt sich jemand aus damit...

  2. #2
    Registriert seit
    Jan 2001
    Beiträge
    832
    Hi,

    vielleicht müssen die Adressen mit einem ; oder , getrennt werden

  3. #3
    Registriert seit
    Jan 2009
    Beiträge
    10
    Dies wird vom API geregelt...
    Per Programm hab ich da keinen Einfluss drauf...

  4. #4
    Registriert seit
    Feb 2001
    Beiträge
    20.207
    Das API ist wohl leider nicht so ganz einfach:
    https://www.ibm.com/support/knowledg...mmsendmail.htm
    Ggf. stimmt die Verpointerung zur nächsten Adresse nicht, der Offset ist 0-basiert.
    Dienstleistungen? Die gibt es hier: http://www.fuerchau.de
    Das Excel-AddIn: https://www.ftsolutions.de/index.php/downloads
    BI? Da war doch noch was: http://www.ftsolutions.de

  5. #5
    Registriert seit
    Nov 2003
    Beiträge
    2.304
    Stimmt die Anzahl der Empfänger (einer der Parameter beim Aufruf von QtmmSendMail?

  6. #6
    Registriert seit
    Jan 2009
    Beiträge
    10
    oh..oh...
    die Anzahl der Empfänger stimmt. Die Verpointerung stimmt.
    Denn: an das API wird ja nur eine Liste übergeben mit allen Adressen, egal ob Receiver, BCC oder CC.
    Da ja jeder Bereich einmal sauber bedient wird, immer der erste Empfänger aus einem Bereich bekommt ja die email, wird also auch die gesamte Liste korrekt sein.

    Hatte noch vergessen: wir arbeiten noch mit Version 6.1...

    Danke für die Antworten

  7. #7
    Registriert seit
    Feb 2001
    Beiträge
    20.207
    Dann würde ich im Moment einfach vermuten, dass je Kategorie nur eine Adresse unterstützt wird.
    Dienstleistungen? Die gibt es hier: http://www.fuerchau.de
    Das Excel-AddIn: https://www.ftsolutions.de/index.php/downloads
    BI? Da war doch noch was: http://www.ftsolutions.de

  8. #8
    Registriert seit
    Jan 2009
    Beiträge
    10
    HmHmm...
    das wäre dann ziemlich blöd für uns...

    Aber vielleicht findet sich ja noch eine andere Idee...

  9. #9
    Registriert seit
    May 2002
    Beiträge
    2.641
    Hallo Siggi_,
    ich würde mir dies einmal zu Gemüte führen:
    QtmmSendMail API - How to send 1 file to multiple receipients
    Derek L - 06:44am Aug 8, 2002 PST
    To whom it may concern:
    This is very new to me but after about 1 week of research and development, I have finally written a program using different examples and techniques. My problem comes when I have 1 MIME email needing to go to 3 people. According to the program examples I have seen, it looks like 1 receipient is sent. How do you send multiple receipients?
    Please email me dledbetter@adeleknits.com.
    Thanks in advance for your help.

    [*Post Reply*] [*Bookmark*] [*Outline*]





    jeff_olen4 - 11:12am AUG 27, 2002 pst (1.) *[*Reply*]* *[* Bookmark*]*
    qtmmsendmail multiple destinations
    Derek, it is not clearly written but there is a repeating structure that is used by the QTMMSENDMAIL API that allows you to send to multiple recipients. The link below has the info...
    http://publib.boulder.ibm.com/iserie...2924/index.htm
    The ADDTO100 structure repeats (if you want it to!). The first field is used to set the offset to the next structure.
    Let me know if this helps.
    Jeff





    Derek L - 11:48am AUG 27, 2002 pst (1.1) *[*Reply*]* *[* Bookmark*]*
    QTMMSENDMAIL
    Jeff,
    Thanks for the reply. Let me see if I understand this.
    Are you saying that the recipient goes first, then you use the offset and set the next recipient and so on?
    What my program currently does is load the first recipient. Then it calls the API. Do I just loop and read all recipients?
    Let me know if I need to send you the code I have just so I can make sure I understand.
    Thanks again.
    derek





    jeff_olen4 - 12:37pm AUG 27, 2002 pst (2.) *[*Reply*]* *[* Bookmark*]*
    multiple recipients
    The way that I understand it is as follows:
    The parameter for the "first recipient address" (which is actually going to be "ALL recipients") is formatted as shown in the table ADDT0100 (refer to the web site again). Therefore the field you use for this parameter should either be very large or variable length. As an example if you were sending to just two recipients jeff@hotmail.com and jeff2@hotmail.com the structure would look something like this:
    binary(4) "offset" = 40 (length to beginning of next entry)
    binary(4) "address length" = 16
    Char(8) "format type" = ADDT0100
    binary(4) "distribution type" = 0 = to, 1 = cc, 2 = bcc
    binary(4) "reserved" = 0
    char(variable) "SMTP address" = jeff@hotmail.com
    The "offset" is 40 because you've got 24 bytes/char in the fields prior to the SMTP address and the SMTP address itself is 16 chars.
    To continue...
    binary(4) "offset" = 41 (even though this is the last entry)
    binary(4) "address length" = 17
    Char(8) "format type" = ADDT0100
    binary(4) "distribution type" = 0 = to, 1 = cc, 2 = bcc
    binary(4) "reserved" = 0
    char(variable) "SMTP address" = jeff2@hotmail.com
    The actual field that you pass will be a single field with all the above information strung together. The simple way to do this would probably be...
    1. Create a data structure similar (or identical!) to the ADDT0100 table.
    2. Fill in the fields with the information for a single recipient.
    3. Concatenate the entire data structure to a large alphanumeric field.
    4. Repeat steps 1 - 3 for all the recipients.
    5. Call the API
    Remember to change the "total number of recipients" field to reflect the correct number.
    HTH,
    Jeff





    Derek L - 06:24am AUG 28, 2002 pst (2.1) *[*Reply*]* *[* Bookmark*]*
    QtmmSendMail - Question?
    I actually think I understand! I do have 1 more question if I may.
    How did you get 24 bytes in front? The book shows File name - Input (Char(*)) Len - Input (binrary(4)) Then you start the addresses.
    Please explain.
    THANKS SO MUCH
    Have a wonderful day!






    jeff_olen4 - 07:08am AUG 28, 2002 pst (2.1.1) *[*Reply*]* *[* Bookmark*]*
    Unless the book is wrong, it should show...
    1. file name (input char(*))
    2. length of file name (input binary(4))
    3. Originator address (input char(*)) - this is the "from" address
    4. length of originator address (input binary(4))
    5. first recipient address (input ADD0100(*)) - this is all of your recipients.
    6. Total number of recipients input(binary(4))
    7. error code (i/o char(*))
    The "first recipient address" is entered in the format shown by the table ADD0100. Therefore, the 40 char offset is calculated ONLY on the ADD0100 table/structure. So...
    4 - offset to next address (input binary(4)) + 4 - length of address (input binary(4)) + 8 - address format type (input char(8)) = "ADDT0100" + 4 - distribution type (input binary(4)) + 4 - reserved (input binary(4)) = 24
    Then to complete the offset you need to add in the actual length of the SMTP destination address (in our example jeff@hotmail.com). In this case the length is 16. So 16 + 24 = 40
    In may easier to think of the recipient address as a multiple occurence data structure with the layout shown in ADD0100.
    HTH, Jeff







    Derek L - 07:45am AUG 28, 2002 pst (2.1.1.1) *[*Reply*]* *[* Bookmark*]*
    QtmmSendMail - Thanks
    Thank you very much. Now, I understand. I was having a problem trying to figure out how the 24 was there. So, I thank you from the bottom of my heart.
    Thanks for helping me through this problem.
    DL

  10. #10
    Registriert seit
    Jan 2009
    Beiträge
    10
    Vielen Dank für die tollen Antworten!
    Nach einigem hin und her erhalte ich als Absender jetzt folgende Reaktion beim versenden an mehrere Empfänger:

    NOT ABLE TO DELIVER MAIL TO SOME/ALL RECIPIENTS.
    REPLY CODES WITH FIRST DIGIT = '4' OR '5' ARE ERROR REPLIES.
    ERRORS THAT DO NOT HAVE ERROR REPLY CODES MAY EXIST.

    HOST PU001A NOT ABLE TO DELIVER MAIL TO FOLLOWING RECIPIENT(S):
    <
    NOT ABLE TO RESOLVE RECIPIENT'S ADDRESS.

    ** TEXT OF MAIL FOLLOWS **
    From: Siegfried.Storr@papierunion.de
    To: siegfried.storr@papierunion.de, fliegersiggi@gmail.com
    Subject: Testmail...
    MIME-Version:1.0
    Content-Type: multipart/mixed;
    boundary="=_Boundary-00=_LKLKSSGHJSGJSHJSGHJSG"

    --=_Boundary-00=_LKLKSSGHJSGJSHJSGHJSG
    Content-Type: text/plain;
    charset="iso-8859-15"
    Content-Transfer-Encoding: 8bit

    Herr XXXXXXXX,

    blabla
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    --=_Boundary-00=_LKLKSSGHJSGJSHJSGHJSG
    name="artikel.csv"
    Content-Disposition: attachment; filename="artikel.csv"
    Content-Transfer-Encoding: base64

    MDI3MDA4MDI1MDAxDQowMjcwMDgwMjUwMjENCg==
    --=_Boundary-00=_LKLKSSGHJSGJSHJSGHJSG--

    Somit stellt sich mir jetzt die Frage: wo sehe ich den Joblog von dem Job, der diese Antwort als QGATE... sendet???

    Ich bin blöd...

    Siegfried

Similar Threads

  1. SMS versenden
    By woodstock99 in forum IBM i Hauptforum
    Antworten: 5
    Letzter Beitrag: 08-11-17, 18:56
  2. Mails erstellen und versenden auf AS/400
    By AK1 in forum NEWSboard Programmierung
    Antworten: 18
    Letzter Beitrag: 16-02-17, 11:04
  3. Mails über SNDSMTPEMM versenden
    By Rainer Ross in forum IBM i Hauptforum
    Antworten: 2
    Letzter Beitrag: 22-09-15, 16:14
  4. Brauche mal Eure Hilfe ... QRY/SQL
    By HoScHiE in forum IBM i Hauptforum
    Antworten: 1
    Letzter Beitrag: 28-09-01, 15:20
  5. Brauche Hilfe im DDS
    By hs in forum IBM i Hauptforum
    Antworten: 6
    Letzter Beitrag: 26-09-01, 10:02

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • You may not post attachments
  • You may not edit your posts
  •