input: Write a python function to send an email using smtplib.
  assert send_email("from@example.com", "to@example.com", "A message") == "Email sent successfully"
  assert send_email("from@example.com", "invalid_email", "A message") == "Failed to send email"
  assert send_email("from@example.com", "to@example.com", "") == "Failed to send email"
output: import smtplib
  from email.mime.text import MIMEText
  from email.mime.multipart import MIMEMultipart
  
  def send_email(from_email, to_email, message):
      try:
          # Validate email addresses and message
          if "@" not in from_email or "@" not in to_email or not message:
              return "Failed to send email"
  
          # Set up the SMTP server
          smtp_server = "smtp.example.com"  # Replace with your SMTP server
          smtp_port = 587  # Replace with your SMTP port if different
          smtp_username = "your_username"  # Replace with your SMTP username
          smtp_password = "your_password"  # Replace with your SMTP password
  
          # Create the email
          msg = MIMEMultipart()
          msg['From'] = from_email
          msg['To'] = to_email
          msg['Subject'] = "Subject"
          msg.attach(MIMEText(message, 'plain'))
  
          # Connect to the SMTP server and send the email
          server = smtplib.SMTP(smtp_server, smtp_port)
          server.starttls()
          server.login(smtp_username, smtp_password)
          server.sendmail(from_email, to_email, msg.as_string())
          server.quit()
  
          return "Email sent successfully"
      except Exception as e:
          return "Failed to send email"