teampoison's avatar

Expected response code 250 but got code "554", with message "554 5.2.252 SendAsDenied;

Expected response code 250 but got code "554", with message "554 5.2.252 SendAsDenied; [email protected] not allowed to send as [email protected]

when i check mail.php or env file in this both file [email protected] not used

mail.php


    /*
    |--------------------------------------------------------------------------
    | SMTP Host Port
    |--------------------------------------------------------------------------
    |
    | This is the SMTP port used by your application to deliver e-mails to
    | users of the application. Like the host we have set this value to
    | stay compatible with the Mailgun e-mail application by default.
    |
    */

    'port' => env('MAIL_PORT', '587'),

    /*
    |--------------------------------------------------------------------------
    | Global "From" Address
    |--------------------------------------------------------------------------
    |
    | You may wish for all e-mails sent by your application to be sent from
    | the same address. Here, you may specify a name and address that is
    | used globally for all e-mails that are sent by your application.
    |
    */

    'from' => [
        'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
        'name' => env('MAIL_FROM_NAME', 'check'),
    ],

i try artisan cache and all other cache removed still same error occur tried also on localhost

0 likes
6 replies
Sinnbeck's avatar

Show the code you are trying to send with

teampoison's avatar

@Sinnbeck

<form id="send-messages-selected-form" method="post" action="{{ route('matches.send_profiles') }}">
                        {{ csrf_field() }}
                        <input type="hidden" name="profile" value="{{ $profile->id }}">
                        <input type="hidden" id="selected-profiles" name="selected_matches" value="">
                        <button class="btn btn-primary submit" type="button">Send Selected Profiles</button>
                    
                    <table class="table table-bordered flip-table">
                        <thead>
                          	<tr>
                                <th><input type="checkbox" id="check-all"></th>
                                <th>Name</th>
                                <th>Father</th>
                                <th>Profile Standard</th>
                                <th>Height</th>
                                <th>D.O.B</th>
                                <th>Current City</th>
                                <!-- <th>Created At</th> -->
                                <th>Status</th>
                                <th><label><input type="checkbox" id="check-all-per">Contact</label></th>
                                <!-- <th><label><input type="checkbox" id="check-all-com"> Communication Media </label></th> -->
                                <th>Action</th>
                        	</tr>
                      	</thead>
                        <tbody>
                            @php $request_id=0; $color="bg-danger"; @endphp
                            @foreach ($matches as $key => $match)
                                @if($request_id!=$match->match_request_id)
                                 @php $request_id=$match->match_request_id; 
                                 //$color=($color=="bg-danger"?'bg-success':'bg-danger'); 
                                 @endphp
                                <tr style="background-color:#f9f9f9" > <!-- class="{{$color}}" -->
                                    <td colspan="{{isAdmin()?12:11}}" class="text-center"><strong>Match at {{date('d M, Y h:i A',strtotime($match->created_at))}} @if(isAdmin())
                                     By {{$match->authorUser->name}}
                                    @endif</strong></td>
                                </tr>
                                @endif

                              	<tr>
                              	    <td>
                                        @if($match->status != 1)<input type="checkbox" class="check-items" value="{{ $match->id }}">@endif


                                        @if(count(mactchMediums($match))>0 || isAdmin())
                                        <!-- @can('send-messages', $match)
                                            <input type="checkbox" class="check-items" value="{{ $match->id }}">
                                        @endcan -->
                                        @endif
                                    </td>
                                    <td>
                                        <a href="{{ route('match.profile', ['match' => $match]) }}">{{ $match->ofProfile->name }}</a>
                                    </td>
                                    <td>{{ $match->ofProfile->father_name }}</td>
                                    <td>{{ getStandardType($match->ofProfile) }}</td>
                                    <td>{{ $match->ofProfile->height }}</td>
                                    <td>{{ $match->ofProfile->getDOBFormat() }}</td>
                                    <td>{{ $match->ofProfile->current_city }}</td>
                                    <!-- <td>{{ date_format($match->created_at, 'd/m/Y') }}</td> -->
                                    <td>{{ $match->status == 1 ? 'Not Approved' : App\Models\Match::$matchStatuses[$match->status] }}</td>
                                    <td>
                                        <label><input type="checkbox" class="{{$match->id}} pre check_all single" value="{{ $match->id }}" name="photo_request[{{ $match->id }}]" > Address</label>
                                        
                                        <label><input type="checkbox" class="{{$match->id}} pre check_all single" value="{{ $match->id }}" name="contact_request[{{ $match->id }}]" > Contact</label>

                                        <!-- Code By Lalit Close -->
                                        <!-- @if(count(mactchMediums($match))>0 || isAdmin())
                                        @if(($match->contact_request=='approved' && $match->photo_request=='approved') || isAdmin())
                                        <label><input type="checkbox" class="all check_all pre {{ $match->id }}" value="{{ $match->id }}"> All</label>&nbsp;&nbsp;
                                        @endif
                                        @if($match->contact_request=='approved' || isAdmin())
                                        <label><input type="checkbox" class="{{$match->id}} pre check_all single" value="{{ $match->id }}" name="contact_request[{{ $match->id }}]" > Contact</label>&nbsp;&nbsp;
                                        @endif
                                        @if( $match->photo_request=='approved' || isAdmin())
                                        <label><input type="checkbox" class="{{$match->id}} pre check_all single" value="{{ $match->id }}" name="photo_request[{{ $match->id }}]"> Photo
                                        </label>
                                        @endif
                                        @endif -->
                                    </td>
                                    <!-- <td>@if(count(mactchMediums($match))>1 || isAdmin())
                                        <label><input type="checkbox" class="all-com com check_all-com {{ $match->id }}" value="{{ $match->id }}"> All</label>&nbsp;&nbsp;
                                        @endif

                                        @php 
                                        $allow_SMS = "allow_sms";
                                        $allow_EMAIL = "allow_email";
                                        $allow_WHATSAPP = "allow_whats_app";
                                        @endphp

                                        @if($match->allow_sms || isAdmin())
                                        
                                        

                                        <label class="{{ (App\Models\SendProfile::checkProfileSMS($match->id, $profile->id, $allow_SMS) == 1) ? 'send_profile_background' : '' }}"><input type="checkbox" class="{{$match->id}} com check_all-com single" value="{{ $match->id }}" name="allow_sms[{{ $match->id }}]" > SMS</label>&nbsp;&nbsp;
                                        @endif
                                        @if($match->allow_email || isAdmin())
                                       
                                        <label class="{{ (App\Models\SendProfile::checkProfileSMS($match->id, $profile->id, $allow_EMAIL) == 1) ? 'send_profile_background' : '' }}"><input type="checkbox" class="{{$match->id}} com check_all-com single" value="{{ $match->id }}" name="allow_email[{{ $match->id }}]"> E-Mail
                                        </label>
                                        &nbsp;&nbsp;
                                        @endif
                                        @if($match->allow_whats_app || isAdmin())
                                      
                                        <label class="{{ (App\Models\SendProfile::checkProfileSMS($match->id, $profile->id, $allow_WHATSAPP) == 1) ? 'send_profile_background' : '' }}"><input type="checkbox" class="{{$match->id}} check_all-com com single" value="{{ $match->id }}" name="allow_whats_app[{{ $match->id }}]"> WhatsApp
                                        </label>
                                        @endif
                                    </td> -->
                                    <td>
                                        <div class="dropdown" style="display: inline-block;">
                                            <button class="btn btn-warning dropdown-toggle" type="button" data-toggle="dropdown">Actions <span class="caret"></span></button>
                                            
                                            <ul class="dropdown-menu">
                                                @can('send-messages', $match)
                                                <li>
                                                    <a href="{{ route('match.followups', $match->id) }}">
                                                        Update Status
                                                    </a>
                                                </li>
                                                <li><div class="dropdown-divider"></div></li>
                                                @endcan
                                                
                                                @if($match->contact_request!='approved' && !isAdmin())
                                                    <!-- <li>
                                                        <a href="{{ route('request.contact', [$match->id, 2,1]) }}">
                                                            Request Contact For Client
                                                        </a>
                                                    </li> -->
                                                @endif
                                                @if($match->photo_request!='approved' && !isAdmin())
                                                    <!-- <li>
                                                        <a href="{{ route('request.contact', [$match->id, 2,2]) }}">
                                                            Request Photo For Client
                                                        </a>
                                                    </li> -->
                                                @endif
                                                @if($match->contact_request!='approved' && $match->photo_request!='approved')
                                                    <!-- <li>
                                                        <a href="{{ route('request.contact', [$match->id, 2]) }}">
                                                            Request All Details For Client
                                                        </a>
                                                    </li> -->
                                                <li><div class="dropdown-divider"></div></li>
                                                @endif
                                                @if($match->allow_sms || isAdmin())
                                                <!-- <li>
                                                    <a href="{{ route('profile.send', $match->id) }}">Send Profile to {{ $match->ofProfile->name }}(SMS)</a>
                                                </li> -->
                                                @endif
                                                <li>
                                                    <a href="{{ route('profile.send', [$match->id,'email']) }}">Send Profile to {{ $match->ofProfile->name }}(E-Mail)</a>
                                                </li>

                                                <!-- Lalit -->
                                                <li>
                                                    <a href="{{ route('profile.send', [$match->id,'email', 'contact']) }}">Send Profile with Contact Details to {{ $match->ofProfile->name }}(E-Mail)</a>
                                                </li>
                                                
                                                @if($match->allow_email || isAdmin())
                                                <!-- <li>
                                                    <a href="{{ route('profile.send', [$match->id,'email']) }}">Send Profile to {{ $match->ofProfile->name }}(E-Mail)</a>
                                                </li> -->

                                                <!-- Lalit -->
                                                <!-- <li>
                                                    <a href="{{ route('profile.send', [$match->id,'email', 'contact']) }}">Send Profile with Contact Details to {{ $match->ofProfile->name }}(E-Mail)</a>
                                                </li> -->
                                                <!-- Lalit Close -->


                                                @endif
                                                @if($match->allow_whats_app || isAdmin())
                                                <!-- <li>
                                                    <a target="_blank" href="{{ route('profile.send', [$match->id,'whatsapp']) }}">Send Profile to {{ $match->ofProfile->name }}(Whatsapp)</a>
                                                </li> -->
                                                @endif
                                                @can('check-permission', 'follow_ups.logs')
                                                <li><div class="dropdown-divider"></div></li>
                                                    <li>
                                                        <a href="{{ route('match.followups.logs', $match->id) }}">
                                                            Follow Up Logs
                                                        </a>
                                                    </li>
                                                @endcan   
                                            </ul>
                                        </div>   
                                    </td>
                                </tr>
                            @endforeach
                        </tbody>
                    </table>
                    </form>
Sinnbeck's avatar

@teampoison Thats a blade template? I assume the sending of the mail happens in a controller or similar?

teampoison's avatar

@Sinnbeck

\Mail::send('emails.match_all_new', compact('selectedMatches', 'requestedMatches', 'ofprofile', 'forprofile'), function($message) use ($profile, $profilePDFs, $images) {
                $message->from(\Config::get('settings.admin_email'));
                $message->to($profile->email, $profile->name);
                $message->subject('A new match for you from');
 if (count($selectedMatches) > 0) {

            \Mail::send('emails.match_all', compact('selectedMatches', 'requestedMatches'), function($message) use ($profile) {
                $message->from(\Config::get('settings.admin_email'));
                $message->to("[email protected]", "Jaspreet");
                $message->subject('A new match for you from');
            });
        }
	return view('emails.match_all', compact('selectedMatches', 'requestedMatches'));
});

settings.admin_email (how to find what email are in admin_email)

on mail i put mail send from ....@gmail.com

teampoison's avatar

Issue Solved Now Mail Send

$message->from(\Config::get('settings.admin_email'));

i Change this to

$message->from("...@gmail.com" "Name");

Sinnbeck's avatar

@teampoison Gmail? Your original post said outlook.com? And why overwrite it if it's det correctly in env/config?

Please or to participate in this conversation.