translate a Python app to C++

Hi Folks:
I am very new to C++. In addition, I found this site, and was excited to join, since I started reviewing C++, and getting ready to take a class. Despite the latter, I have some experience with Python, yet this is mainly in the form of scripting.

My first endeavor or task is to see if I can translate my Python app into C++ apps. One of my favorite apps I created in class is the following. I originally coded it on Ubuntu; however, on my Window boxes I added the Python path to my environment variables and use Schedule Tasks to call it. On Linux I use Cron.


Python email app
//

#!/usr/bin/python
import smtplib
sender = 'automailer@logserv.com'
receivers = ['address@email.com', 'address@email.com']

message = """From: automailer <automailer@logserv.com>
To: Receiver <address@email.com>
Subject: 1-Hour Keep alive

Python 2.7.3
autoemailer

##################
# autoemailer #
##################

1-Hour Keep Alive



"""
try:
smtpObj = smtplib.SMTP('192.168.15.17', 25)
smtpObj.sendmail(sender, receivers, message)
print "Successfully sent email"
except SMTPException:
print "Error: unable to send email"

//
I main use this script/app for keep alives to services from boxes. I serves the purpose I need.


Thank you
JJ
Well, smtplib is a python module, so unless there is a C++ equilent libary or some sort of wrapper then you cant use it. As for the rest of your post, I dont really understand what you are asking, do you want to create a program which converts python code to C++ code? Or do you just want to do it manualy? I dont know python, but it looks like quite a simple code. Just learn a bit of C++ and you can convert it manually.
@Owain
Thank you for answering my post. Yes...I want to be able to convert the application manually. I understand methods and procedures in creation will be different, but I thought it would give me a good learning experience since I understand the creation of the Python version.
Topic archived. No new replies allowed.