|
|
import streamlit as st |
|
|
from email_sender import send_email |
|
|
import utils |
|
|
|
|
|
def main(): |
|
|
st.title("Email Sending Application") |
|
|
|
|
|
with st.form(key='email_form'): |
|
|
Linkedin = st.text_area("Linkedin Profile") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
submit_button = st.form_submit_button("Send Email") |
|
|
|
|
|
|
|
|
|
|
|
if submit_button: |
|
|
text,email=extract_text_and_emails_from_linkedin(url) |
|
|
|
|
|
recipient_email = email |
|
|
email_subject = utils.Subject(text) |
|
|
email_body = utils.Body(text) |
|
|
attachment = 'Vaibhav_Wadhwa.pdf' |
|
|
send_email(recipient_email, email_subject, email_body, attachment) |
|
|
st.success(f"Email sent successfully{email}!") |
|
|
else: |
|
|
st.error("Please fill in all fields.") |
|
|
return |
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
main() |