# 22. Virtuoso Functions Guide - nntp_post

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
mime_body
mime_part
mime_tree
nntp_auth_get
nntp_auth_post
nntp_get
nntp_post
pem_certificates_to_...
pop3_get
smime_sign
smime_verify
smtp_send
uuvalidate
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY
Functions Index

## nntp_post

Post message to NNTP server
array nntp_post (in server varchar, in body varchar);
Description

Nntp_post is used to post a message to the server running the Network News Transfer Protocol as defined in the rfc977.

Parameters
server – The host to connect with. IP address or hostname:port. There is no default for port, so to connect to the standard port for NNTP, use <hostname/IP address>:119
body – The body stringThe structure of the message must comply with RFC 850 (Standard for Interchange of USENET Messages).
Return Types

1 on success or error

Errors

SQLState | Error Code | Error Text
--- | --- | ---
2E000 | NN011 | Invalid address for News Server at [host]
08001 | NN012 | Unable to Contact News Server at [host]
08006 | NN013 | Misc. error in connection in nntp_post

Examples
Post message to remote NNTP

This example post message to a remote NNTP server.

    SQL> set MACRO_SUBSTITUTION off;
    SQL> select nntp_post ('news.openlinksw.co.uk:119',
      'From: "Demo User" user@demo.com\r\nSubject: Test Virtuoso nntp_post function\r\nNewsgroups: openlink.public.test\r\n\r\nTEST IS OK.\r\n\r\n.\r\n') ;
    callret
    VARCHAR
    _______________________________________________________________________________

    1

    1 Rows. -- 782 msec.
    SQL>