File size: 1,073 Bytes
7994ba7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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")
        # recipient_email = st.text_input("Recipient's Email Address")
        # email_subject = st.text_input("Email Subject")
        # email_body = st.text_area("Email Body")
        #attachment = st.file_uploader("Upload Attachment", type=["pdf", "docx", "txt"])

        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()