How to Install Python to Run Aspose.Email for Python via .NET

This topic provides detailed steps on how to install python to run Aspose.Email for Python via .NET. It assumes that you have .NET Framework configured in any of Microsoft Windows or Linux-based systems and walks you through the process of installing all the necessary software to run Aspose.Email code in Python. We will install Python during these steps and save an Email message to verify the environment setup.

Steps to Install Python to Run Aspose.Email for Python via .NET

  1. It is assumed that you have a Microsoft Windows or Linux configured with .NET framework support. For more information, you can visit Install .NET on Windows and Linux
  2. Install Python extension in VS Code
  3. Install Python 3.9.6
  4. Install Pip command
  5. Install Aspose.Email for Python via .NET
  6. Write code and execute the Aspose.Email for Python code to send an email Message using SMTP

If you have an environment satisfying the first two steps, you can ignore them and execute the subsequent commands in the terminal or command prompt inside your Linux or Windows environment. You need to install Python and Pip3 to install Aspose.Email.

Script to Install Python to Run Aspose.Email for Python via .NET

1. Install .NET Framework (Required for Ubuntu only)
#For Ubuntu
apt update
apt upgrade
apt install sudo
sudo apt update
sudo apt install wget
wget -q https://packages.microsoft.com/config/ubuntu/19.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1
2. Install Python 3.9.6
#For Ubuntu
sudo apt install -y python3.9.6
# For MS Windows
install using MSI package. Be sure to select the check box to set the path during installation
3. Installing Pip Command
# For Ubuntu
sudo apt install python3-pip
# For Windows
python -m pip install --upgrade pip
4. Install Aspose.Email
python -m pip install Aspose.Email-for-Python-via-NET
# Additional requirements for Ubuntu to install libgdiplus and libc6-dev
# For Ubuntu only
apt-get update
apt-get install -y libgdiplus
cd /usr/lib && ln -s libgdiplus.so gdiplus.dll
apt-get install -y --no-install-recommends libc6-dev

If you already have .NET, Python 3.9.6, and PIP environment setup, you can commence from Step 4 onward to work with the API. It is suggested to use Python 3.9.6 with API instead of older Python2.x.

A working sample code using the API features to send an email using SMTP is also given to verify the installation. You can try more samples and explore the API features to create the different examples you want to produce using the API.

 English