0

I have a website that uses php mailer to send form input to a phone using the Verizon service. The issue is that the online form is being sent to a phone via text using the PHP mailer.

On the Android phones, the email is received properly and displayed in its entirety as a text message.

On an iPhone, the email is received as a text message, but it's truncated and only a portion is displayed. Notice that it stops at 'Cu.' It supposed to have about eight more lines of information pertaining to the appointment schedule. I'm wondering if iPhone has a character limit shorter than Android phones.

Anyone know how to avoid the text from being truncated on the iPhone?

I've googled for information, but all I get is how to fix the native iPhone email client. Which, isn't the issue.

Thank you.

It's pretty straight forward. The code pulls the form variables and assigns them as variable variables to the $message variable in a foreach loop.

<pre>
    if ($OK_customers && $OK_appointments && $OK_customers_appointment) {
    $message = '';
    $selected_appt_day = date('l', strtotime($appt_date));
    $selected_appt_date = date('m-d-Y', strtotime($appt_date));
    $message .= "\r\n: ".$selected_appt_day.", ".$selected_appt_date."\r\n\r\n";
    $message .= "Please confirm:\r\n\r\n";

    foreach ($expected as $item) {
        if (isset(${$item}) && !empty(${$item})) {
            $val = ${$item};
        }else  {
            $val = 'Not Selected';
        }
        if (is_array($val)) {
            $val = implode(', ', $val);
        }

        $item = str_replace(['_', '-'], ' ', $item);
        $message .= ucfirst($item) . ": $val\r\n";          
    }

    $message = wordwrap($message, 70);
    $mailSent = mail($to, $subject, $message, $headers);
    if (!$mailSent) {
        $errors['mailfail'] = true;
    }
}
</pre>

Screenshot of iPhone text message.

6
  • can you provide an example of the message so we can see where its being truncated.
    – user10051234
    Commented Feb 26, 2019 at 23:21
  • Unfortunately, I can't provide an example of the message because I don't own an iphone. The issue was brought to my attention by the recipient of the form; whom owns an iPhone.
    – Lexiriam
    Commented Feb 26, 2019 at 23:37
  • i'm thinking its choking on some character, you may need to adjust the encoding, but that's just speculation.
    – user10051234
    Commented Feb 26, 2019 at 23:40
  • thanks, tim. that's a good start as any. appreciate it. it's just odd that android doesn't have an issue and iphone does.
    – Lexiriam
    Commented Feb 26, 2019 at 23:46
  • please share your code, so we can suggest you some fixes if possible.
    – Vidal
    Commented Feb 27, 2019 at 2:11

0

Browse other questions tagged or ask your own question.