All the data you need is in msdb, in the following tables for the most part:
msdb.dbo.sysmail_server
msdb.dbo.sysmail_account
msdb.dbo.sysmail_configuration
msdb.dbo.sysmail_principalprofile
msdb.dbo.sysmail_profile
msdb.dbo.sysmail_profileaccount
Based on the values in those tables you would want to create a script that executed the following stored procedures:
msdb.dbo.sp_add_operator
msdb.dbo.sysmail_add_account_sp
msdb.dbo.sysmail_add_profile_sp
msdb.dbo.sysmail_add_profileaccount_sp
msdb.dbo.sp_set_sqlagent_properties
master.dbo.xp_instance_regwrite
Regards,
Toby