I am using Active admin to save my email templates. I am also using Mail Gun to send my emails.
The whole process works absolutely fine if I define my email boday as text such as:
body = "This is the text in my email"
If however I attempt to use the template I made in my active admin like so:
body = load_rendered_template("new_quote_email")
I get the error: wrong status line: '<html>'
The app is using SSL would this have anything to do with it? This is the same error both in production and development.
Related
We use Webform Drupal 8 module to handle newsletter subscription on a website. An html formatted email is sent to confirm subscription. Unfortunately, this email is sent with only content-type:text/html, and you know how picky Spamassassin is about this. It's a real deliverability issue.
We'd like to be able to send that email with a content-type:multipart/alternative, with 2 parts : one with text/html content-type and one with text/plain.
How can we do this ? We installed "mail system" and "mime mail" modules, but we can't figure out how to use them, or even if it's the right solution.
Has anyone ever managed to do this?
Have a look at this module.
Once mime-mail module is enabled you can modify the emails send by Drupal using hook_mail_alter hook (see here) and add plain-text version.
In a custom module, in your mymodule.module file you can do something like this:
/**
* Implements hook_mail_alter().
*/
function mymodule_mail_alter(&$message) {
//to specify which email need altering based on id
//without this all emails send will be altered
if (isset($message['id']) && $message['id'] == 'contact_page_mail') {
//set plain text
$message['params']['plaintext']= "HTML support needed";
}
}
For my website, i use a free template form startbootstrap.com, in this template there is a "Send Mail" button, i tried to get it running, but it doest, work. How can i make it work?
I have already changed the mailto#something.com to my real email and it didnt work. I am not very experienced in web developing, so it might be a very simple thing. Any help would be much appreciated
Here is the code section for the email part: \n
The only line i changed was :
action="mailto:myreal#mail.com" method="POST" enctype="text/plain">
This section tells me that i should configure my web server differently if things dont work, how would i do that
<!-- The form should work on most web servers, but if the form is not working you may need to configure your web server differently. -->
I expected this part, to just send an email to me from the provided email addres with the given content, but when i try to run it it says:
Sorry, it seems that my mail server is not responding. Please try again later!
Thanks in advance!
I don't know which template you have chosen, but with "Freelancer" there's a contact_me.php located under mail folder, where you should configure this part:
$to = "yourname#yourdomain.com"; // Add your email address inbetween the "" replacing yourname#yourdomain.com - This is where the form will send a message to.
$subject = "Website Contact Form: $name";
$body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nName: $name\n\nEmail: $email\n\nPhone: $phone\n\nMessage:\n$message";
$header = "From: noreply#yourdomain.com\n"; // This is the email address the generated message will be from. We recommend using something like noreply#yourdomain.com.
$header .= "Reply-To: $email";
Since you need php and mail server for this to work, after configuration you can deploy it to a server like xampp or wampp if you'd like to test it locally or just copy it to a real webserver.
We have set up Odoo 8 as a multi-user helpdesk tool, which creates a new project issue for each incoming mail. Incoming and outgoing servers are configured correctly and system parameters are set to
mail.catchall.domain: company.tld
mail.catchall.alias: helpdesk
mail.bounce.alias: bounce
The problem now is that every time a user comments the mail thread to answer the original issue creator, a new mail is generated with header
FROM: [user]#company.tld
TO: [followers]
REPLY-TO: helpdesk#company.tld
Which is totally fine but leads to a sending failure due to our SMTP configuration. To get around this we want to achieve that all outgoing E-Mails are sent from the same specified address, like helpdesk#company.tld, no matter which user response to the thread.
How do we achieve this?
I had specific issue when I was working on Odoo 8 and I found fix but its not recommended action from developer view, because changing odoo source code is not recommended and changes can be lost.
So what I did was to change email from address to real email from address. Yes it's weird but that's how Odoo works. Odoo is always sending from one specific email address and changes email from to user email address, but if you will look at email carefully you will notice that real sender is always same.
The fix is changing this line
smtp_from = message['Return-Path']
to this line
smtp_from = tools.config.get('email_from')
in openerp/addons/base/ir/ir_mail_server.py file.
PS I don't like this solution.
We are in the process of converting a batch job that processes our bounced emails that we send. We are switching from Redemption to EWS (just upgraded to Exchange 2010 from Exchange 2003). As you know bounced emails come in different forms. I have been able to work through all the test case emails i've got except for the ones that come in the form of:
Your message did not reach some or all of the intended recipients.
Subject: Hello
Sent: 4/01/2012 8:16 AM
The following recipient(s) cannot be reached:
hi#foo.com on 4/01/2012 8:19 AM
The e-mail system was unable to deliver the message, but did not report a specific reason. Check the address and try again. If it still fails, contact your system administrator.
smtp.mydomain.com #5.0.0 smtp; 5.3.0 - Other mail system problem 554-"delivery error: dd This user doesn't have a foo.com account (hi#foo.com) [-5] - mail.foo.com" (delivery attempts: 0)>
This is what is displayed in outlook. When i read the email with EWS the Body is empty. I need to look at the information above when i get the email with EWS. The emails have an attachment (which is the original email) though it doesn't look that way in outlook. I've tried to look at almost all the properties that comes back from EWS and have yet been able to find the text above. Redemption allow you to look at this info using ReportText. What we are specifically looking for is the email error delivery code. We do different things based on this code.
Edit: To be clearer the Body Property on my other test cases isn't empty. I'm loading the emails like:
Dim emailPset = New PropertySet(BasePropertySet.FirstClassProperties)
emailPset.RequestedBodyType = BodyType.Text
Dim f = EmailMessage.Bind(email.Service, email.Id, emailPset)
Update1: After some research it looks like i need to be able to read the Recipients table of the message in the PR_NDR_STATUS_CODE & PR_REPORT_TEXT fields. Still searching if there is a way to do this in EWS.
We were able to get enough info the
smtp.mydomain.com #5.0.0 smtp; 5.3.0 - Other mail system problem 554-"delivery error: dd This user doesn't have a foo.com account (hi#foo.com) [-5] - mail.foo.com" (delivery attempts: 0)>
part which is what we needed by telling the object to load the MIME content.
Definitely not the most straight forward API to use but hopefully we don't hit any more hickups.
Something really weird is going on with boto and Amazon SES. I've tested this at-least 50 times: Sending an email using:
conn = SESConnection(accessKey, secretKey)
conn.send_email(source=fromEmail, subject=subject, body=body, to_addresses=toAddress, cc_addresses=cc_addresses, bcc_addresses=bcc_addresses, format='html', reply_addresses=None, return_path=None)
works as long as the body is regular text. A soon as body contains a link, like "127.0.0.1", the email doesn't go through. send_email doesn't return an error, it just doesn't go through and I can't tell why. The only exception is if the link is the very last piece of text in the body. So, body = "go to 127.0.0.1" will get into the recipients' inboxes, but body = "go to 127.0.0.1 and click on the link" will not work.
Weird, right? What's going on?
EDIT, several wasted hours later:
So after killing several hours on this, I don't know exactly what the problem is, but I know that it doesn't have to do with Boto or Amazon SES. I sent the exact same email to a different address and had no problems with it. Now this is seriously weird and stupid. The email used for my school runs on Google apps and exhibits the wacky behavior described above. My personal email is plain old gmail and doesn't have this issue at all. I even checked the spam folder for my school email and it's not there.
So that's it, the difference between having an "http" and an "https" in the body of the email, and only for certain email accounts. No errors, just a lost email. WTF?