Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Component({
- selector: 'app-application',
- templateUrl: 'app.application.html'
- })
- export class ApplicationComponent {
- public uploader: FileUploader = new FileUploader({
- url: MyEndPoint
- });
- @application.post()
- def job_application(request):
- request.response.headerlist.extend(
- (
- ('Access-Control-Allow-Origin', AngularClient),
- ('Content-Type', 'application/json'),
- ('Access-Control-Allow-Credentials', 'true'),
- ('Allow', 'GET, POST')
- )
- )
- mailer = Mailer(host="smtp.gmail.com",
- port="465", username="makeemup@gmail.com", password="password", ssl=True)
- message = Message(subject="It works!",
- sender="makeemup@gmail.com",
- recipients=["makeemup@gmail.com"],
- body="hello"
- )
- if request.POST:
- attachment = Attachment("photo.doc", "doc/docx", str(request.body))
- message.attach(attachment)
- mailer.send_immediately(message, fail_silently=True)
- return request.response
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement