I am trying to actually test sending an email using mailtrap.io, and I set up the email server as directed, however, when I try to do the following:
form = InterestedForm(request.POST)
if form.is_valid():
name = form.cleaned_data['name']
email = form.cleaned_data['email']
subject = "Index form: Interested in Ucodon"
message = 'Name: ' + name + '\n' + 'Email: ' + email
recipients=['test@gmail.com']
send_mail(subject, message, recipients, fail_silently=False)
thanks = True
I get the following error:
TypeError: send_mail() takes at least 4 arguments (4 given)
I have even tried the following:
send_mail(subject=subject, message=message, recipients=recipients, fail_silently=False)
Also, I have defined EMAIL_HOST_USER. I am currently using EMAIL_HOST='mailtrap.io'.