Mandrill text field character limit PHP - php

I am trying to send a simple email using Mandrill and everything works well until I put too much text into the text field, here is what I mean:
$message = array(
'subject' => $subject,
'text' => $content,
'from_email' => 'myemail#gmail.com',
'to' => array(
array(
'email' => $toMail,
)
)
);
$mandrill->messages->send($message, $async=false, $ip_pool=null, $send_at=null);
So when $content contains more than about 1000 characters the email does not send and I get a 500 error, which seems to be an API timeout. However I need to send emails with up to 20000 characters in them. Has this happened to anyone? Also this worked a couple months ago for me, I am not sure why it does not work anymore.
I saw that SMTP headers can only be 1000 characters long, but the text segment doesn't land in the header does it?
UPDATE: So interestingly enough, it still works fine on my main computer. I moved the website to another machine running ubuntu 14.04 and that is where the error started appearing. Anybody have any ideas as to why?

Related

Sendgrid can't receive emails in application

I'm trying to receive e-mails sended to my account on sendgrid.
So What I basically have is the following:
A sendgrid account linked to http://www.rallypodium.be
A cloudflare account linked to http://www.rallypodium.be server IP adress.
A server on DigitalOcean.
Good, So I'm running Nginx on that server and I want to be able to get the e-mails send to #rallypodium.be to be saved and stored inside of my database wich is on the same DigitalOcean server.
I've set up the Inbound Parse like this:
HOST: www.rallypodium.be
URL: http://www.rallypodium.be/inbound/parse/mail
My domain is whitelabled.
I've read the docs for 10 times and still didn't figure out what I'm doing wrong.
This is how I store them:
public function ReceiveMail(Request $request)
{
DB::table('email')->insert([
'headers' => $request->get('headers'),
'html' => $request->get('html'),
'from' => $request->get('from'),
'to' => $request->get('to'),
'cc' => $request->get('cc'),
'subject' => $request->get('subject'),
'dkim' => $request->get('dkim'),
'spf' => $request->get('spf'),
'envelope' => $request->get('envelope'),
'charsets' => $request->get('charsets'),
'spam_score' => $request->get('spam_score'),
'spam_report' => $request->get('spam_report'),
'attachments' => $request->get('attachments'),
'attachment-info' => $request->get('attachment-info'),
'attachmentX' => $request->get('attachmentX')
]);
return 'ok';
}
If I take a look at the Activity Feed, then I see this:
The error message is the following:
EMAIL: robin#rallypodium.be
REASON: error dialing remote address: dial tcp 104.24.101.114:25: i/o timeout
SMTP-ID: <1f7f313f27fd051b525581562e6af9b5#rallypodium.be>
PROCESSED STRING: August 1, 2016 - 06:53:45PM
MSGID: J1irmehmR_GELI7tIpPXNg.filter0810p1mdw1.1861.579F77CC27.0
oh and this is my cloudflare DNS: http://prntscr.com/c0bjl8
Can someone help me out?
Thanks!
You are essentially trying to receive email through CloudFlare, but unfortunately CloudFlare doesn't proxy SMTP/email traffic.
Instead you'll need to add a grey-clouded record to manage your email, this will allow your email to be routed straight to your origin without CloudFlare blocking it. Note that grey clouded domains can reveal your IP Address, it is therefore recommended to have your email server on a separate server to your webserver; or even better use a Cloud email provider and get emails from them.

ALL GCM parameters?

i´ve written a "pushserver" for my app via PHP.
The push notifications i´ve sent via PHP are all received on the device, so far.
But, i can just send/set the "message" and "title", see:
$fields = array(
'registration_ids' => $registrationIDs,
'data' => array(
'message' => $message,
'title' => 'My App',
'vibrate' => 1,
'sound' => 1,
'icon' => "http://example.com/image.jpg",
"style" => "inbox"
),
);
"icon" and "style" are not working (vibrate and sound not tested, yet).
Every link for the parameters i´ve found is broken or kind of "you need to do object.setSomething() in JAVA.
Is there a list anywhere where i can see ALL parameters, which i can send to GCM? No matter, what language i use?
Cheers,
Chris
couple of things need to keep in mind while all the data which you sending from server end
Is there a list anywhere where i can see ALL parameters,
exp :- you can send as many parameters as you want but offcourse there is limitation but not key specific just like you can use "textmessage" instead of "message" but make sure to retrieve the value from same key which you are assigning from server end
1) please make sure that you are getting all the data in gcmintentservice class try to print the log of all intent data.
please remember that this is just a string data it is not going to download the image for you. you have to download using volley library or any suitable library

PHP code to Read Sent Items from an Email Account

I need to read sent items from an email account to insert the details into a database as part of development of a support ticket system.
I have managed to implement reading inbox emails using the below code and successfully inserted those into the database.
$stream = #imap_open($current_mailbox['mailbox'], $current_mailbox['username'], $current_mailbox['password']);
$overview = imap_fetch_overview($stream,$email_id,0);
$message = imap_fetchbody($stream,$email_id, 1.2);
I have searched all over the internet and stackoverflow to find a solution, but no use. I haven't found even a single discussion regarding this (Reading sent items from an email account).
Hope someone here can help me in this issue by sharing some useful code snippets or URLs for reference.
Thanks in advance.
Got it working and successfully retrieved all sent emails by replacing {mail.domain.com:143/notls} with {mail.domain.com:143/notls}INBOX.Sent.
That is by setting the value of $current_mailbox['mailbox'] to {mail.remanns.com:143/notls}INBOX.Sent
The complete code is
$mailboxes = array(
array(
'label' => 'domain.com',
'enable' => true,
'mailbox' => '{mail.domain.com:143/notls}INBOX.Sent',
'username' => 'mail#domain.com',
'password' => 'mypassword'
)
);
$stream = #imap_open($current_mailbox['mailbox'], $current_mailbox['username'], $current_mailbox['password']);
Thank you Darren for guiding me through the right path. I figured it out by following you suggestion regarding finding the sent box name first.

CakePHP emails suddenly stopped working

I have been using CakePHP's email class for close to a year now. The system has been sending html emails without problems. Two days ago I received reports that customers were not receiving their notifications. I noticed as well that I wasn't receiving my admin notifications.
My first thought was something changed with my server (hosted by GoDaddy). I do not believe it is my hosting provider as I have tested a php's raw mail() function and even sent a quick text email through CakePHP's class. I also tested each debug mode and error logs, nothing to indicate an error occurred. Here is the code I have been using (successfully) since a couple days ago. This code is the same around 10 times throughout my app.
$Email = new CakeEmail();
$Email->template('order_status_change', 'default')
->emailFormat('html')
->to($order['Order']['email'])
->subject('blah blah ' . $order['Order']['id'] . ' status change: ' . $status['Status']['label'])
->from(array('myemail#gmail.com' => 'blah blah'))
->viewVars(array(
'id' => $order['Order']['id'],
'firstName' => $order['Order']['first_name'],
'statusLabel' => $status['Status']['label'],
'statusDescr' => $status['Status']['description']
))
->send();
A couple things to note:
I have confirmed that the html template 'order_status_change' and
default layout are in the correct folders (they were working before)
I have confirmed that the variables are all correctly set at the
time of email
If I have to switch to text emails I will but I cannot seem to fathom how the code would suddenly stop working. The only thing I have changed is the debug mode (which I have been doing since the beginning).
Update
Emails stopped working again so I switched over to text mail. However for some odd reason when I put a url in the body (like http://www.google.com) the mail fails. However if I remove just the .com then it will go through. What the hell is happening?
Update 2
This is my current config that will send out text emails without links in them (when I say links I mean a url string)
class EmailConfig {
public $godaddy = array(
'transport' => 'Smtp',
'host' => 'relay-hosting.secureserver.net',
'port' => 25,
'timeout' => 300,
'log' => true,
'charset' => 'utf-8',
'headerCharset' => 'utf-8'
);
}
I confirmed that Go Daddy does not need authentication and the port is 25.

SugarCRM EmailMarketing doesn't send emails

What I'm doing:
I use SugarCRM.
At first I complete email settings in /index.php?module=EmailMan&action=config. Test letter send fine. That works OK.
Then I create new emailing list using module "Campaigns". Then I move to a wizard to create new email /index.php?action=WizardMarketing&module=Campaigns.... and send emails.
Finally emails are sent. I watch og and see "SUCCESS" (warn only here because I changed its logging status in code from debug to warn):
Mon Sep 10 11:17:42 2012 [13138][1][WARN] Email delivery SUCCESS:Array
(
[date_entered] => 2012-09-10 07:17:20
[date_modified] =>
[user_id] => 1
[id] => 118
[campaign_id] => 362acd98-9980-c24b-921e-5020db524444
[marketing_id] => a00e472d-6026-6fc6-8919-5020db14f6a8
[list_id] => 9ac9c172-feb3-1024-bf2a-5018f1e4074b
[send_date_time] => 2012-09-10 05:05:00
[modified_user_id] =>
[in_queue] => 0
[in_queue_date] =>
[send_attempts] => 0
[deleted] => 0
[related_id] => ec106592-598f-9b45-e3e4-5022647678a6
[related_type] => Prospects
)
So seems like everything is ok. But.. I don't receive any email. And also I don't see any sent emails on DetailView (/index.php?action=DetailView&module=Campaigns....).
But they can be found in Blocked emails!
What I've done:
I tried to change email setting in EmailMan module config for inbox/outbox. Seems like they work fine with test emails. Also i tried to find php problems and changed modules\EmailMan\EmailManDelivery.php logging for success email from debug to warn to make them showing in *.log file.
Question:
Why are my emails blocked. And what do I need to do to make them send successfully?
Thanks for any help and ask my if more info is needed.
Ok, I luckily found problem just a second ago on one forum about Sugar. The problem with Blocked emails was... that system don't send two or more emails on one adress, so other tries were blocked. Creating new Marketing Company solves this problem.

Categories