Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8778853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:37:53+00:00 2026-06-13T19:37:53+00:00

this is the method to send mail by python program. def Send_Mail(self, username, password,

  • 0

this is the method to send mail by python program.

def Send_Mail(self, username, password, receiver, subject, body):
    username = str(username)
    password = str(password)
    receiver = str(receiver)
    subject = str(subject)
    body = str(body)
    Username = username
    Password = password
    Sender = username
    Destination = [receiver]
    Subject = subject
    Content = body
    text_subtype = 'html'
    SMTPserver = 'smtp.gmail.com'
    msg = MIMEText(Content, text_subtype)
    msg['Subject'] = Subject
    msg['From'] = Sender
    conn = SMTP(SMTPserver)
    conn.set_debuglevel(False)
    conn.login(Username, Password)
    conn.sendmail(Sender, Destination, msg.as_string())
    conn.close()

calling this method by

Classname.Send_Mail(<emailid>,<password>,<destination email-id>,<subject>,<body>

this code is working perfectly,
but need to set expiry date while sending mail,so that sent mail must auto delete from the inbox after specified time.
help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:37:54+00:00Added an answer on June 13, 2026 at 7:37 pm

    As far as I know there is no such things as “auto-delete” anywhere in the SMTP or another mail related standard. Additionally I have never heard of a “feature” like this.

    So the answer is: You can’t

    (Maybe their are mail clients that support such things but this would be a “works only in client X” feature. So for an more useful answer you would have to provide the target client.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use this method to send a mail on my website : $message=Hello; $headers='From:
Ok so i download a image and send the input stream to this method
How this UIButton rewind can send notification to UIButton play to perform playpauseaction method
I was using SMTPClient.Send(mail) method to send emails, but then I saw, if the
I'm trying to override the method 'send_confirmation_instructions' as shown here: http://trackingrails.com/posts/devise-send-confirmation-mail-manually-or-delay-them with: def send_confirmation_instructions
I have a method that generates a PDF file using Reportlab library: def obtenerPDFNuevoPedido(self,
I've got this method here, I wanted to go e.Mail.To = MAC, but apparently
This my working method to send a email Sub emailConfirm() Dim email As String
I'm trying to send an e-mail with Codeigniter like this: $this->load->library('email'); $this->email->from(myemail@email.com); $this->email->reply_to(myemail@email.com); $this->email->to(myemail@email.com);
I live in Turkey. I can send sms to local numbers with this method:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.