之在前我們可以使用REMOTE_ADDR =就可以找到遠端的位址
現在還是一樣的簡單.
$ip=Request::ip();
這樣就可以取得IP了
之在前我們可以使用REMOTE_ADDR =就可以找到遠端的位址
現在還是一樣的簡單.
$ip=Request::ip();
這樣就可以取得IP了
That’s how I made it work
$message->from($companyEmail, ”);
$message->replyTo($companyEmail, ‘Email Agent Evmeetings’);
$message->to($to, ”)->subject($subject);
$message->setBody($calendar_invitation, ‘text/calendar; charset=”utf-8″; method=REQUEST’);
$message->addPart($body, “text/html”);
Added the calendar in body and changed the mime type to ‘text/calendar; charset=”utf-8″; method=REQUEST’
and used addPart($body, “text/html”); method to add html body in the email.
Full code:
\Mail::send('emailTemplates.dummy', ['emailBody'=>$row->body], function(Message $message) use ($to,$subject,$attachments,$cc, $body, $calendar_invitation, $companyEmail,$replyTo)
{
$message->from($companyEmail, trim(env("email_agent_name")));
$message->replyTo($replyTo, trim(env("email_agent_email")));
$message->to($to, '')->subject($subject);
$message->setBody($calendar_invitation, 'text/calendar; charset="utf-8"; method=REQUEST');
$message->addPart($body, "text/html");
$attachments = unserialize($attachments);
foreach($attachments as $attachment){
if(file_exists(public_path()."/".$attachment['location'])){
$message->attach(public_path()."/".$attachment['location'], array('as'=>$attachment['name'].".".pathinfo(parse_url($attachment['location'])['path'], PATHINFO_EXTENSION),
'mime' => mime_content_type ( public_path()."/".$attachment['location']) ));
}
}
$cc = unserialize($cc);
foreach($cc as $anotherEmail){
$message->cc($anotherEmail);
}
});
原文來源