1#!/usr/bin/perl 2 3use strict; 4use warnings; 5 6use Net::DRI; 7 8my $dri=Net::DRI->new(); 9 10eval { 11############################################################################################################ 12 13## You need to modify the following information to make this script work : 14## Cc & Bcc are added to all outgoing messages, you can remove them if not needed 15## smtphost is the server to connect to by SMTP to send emails 16## CLIENTID/CLIENTPW are your AFNIC credentials 17## test@localhost is the address that will be put in the From: field of all outgoing messages. 18 19$dri->add_registry('AFNIC', { clid => 'CLIENTID' } ); 20$dri->target('AFNIC')->add_current_profile('profile1','email',{cc=>'testcc@localhost',bcc=>'testbcc@localhost',smtphost=>'localhost'},['CLIENTID','CLIENTPW','test@localhost']); 21 22my $cs=$dri->local_object('contactset'); 23my $co=$dri->local_object('contact'); 24$co->org('MyORG'); 25$co->street(['Whatever street 35','��p ��']); 26$co->city('Alphaville'); 27$co->pc('99999'); 28$co->cc('FR'); 29$co->legal_form('S'); 30$co->legal_id('111222333'); 31$co->voice('+33.123456789'); 32$co->email('test@example.com'); 33$co->disclose('N'); 34 35$cs->set($co,'registrant'); 36$co=$dri->local_object('contact'); 37$co->roid('TEST-FRNIC'); 38$cs->set($co,'tech'); 39 40my $ns=$dri->local_object('hosts'); 41$ns->add('ns.toto.fr',['123.45.67.89']); 42$ns->add('ns.toto.com'); 43 44my $rc=$dri->domain_create('toto1.fr',{pure_create => 1, contact => $cs, maintainer => 'ABCD', ns => $ns}); 45print "Mail successfully sent.\n" if $rc->is_success() && $rc->is_pending(); 46 47$co=$dri->local_object('contact'); 48$co->roid('JOHN-FRNIC'); 49$co->name('John, Doe'); ## Warning : AFNIC requires a , 50$co->street(['Whatever street 35','��p ��']); 51$co->city('Alphaville'); 52$co->pc('99999'); 53$co->cc('FR'); 54$co->voice('+33.123456789'); 55$co->email('test@example.com'); 56$co->disclose('N'); 57$co->key('ABCDEFGH-100'); 58$cs->set($co,'registrant'); 59 60$rc=$dri->domain_create('toto2.fr',{pure_create => 1, contact => $cs, maintainer => 'ABCD', ns => $ns}); 61print "Mail successfully sent.\n" if $rc->is_success() && $rc->is_pending(); 62 63############################################################################################################ 64 65}; 66 67if ($@) 68{ 69 print "AN ERROR happened !!!\n"; 70 if (ref($@)) 71 { 72 $@->print(); 73 } else 74 { 75 print($@); 76 } 77} else 78{ 79 print "No error"; 80} 81 82print "\n"; 83 84exit 0; 85