Jump to content

Having some problems sending mail to some address's


Shadowing

Recommended Posts

Hey guys having a few issues sending mail to some address's

I can send mail to all major emails, gmail,hotmail, yahoo etc....

 

One i know for sure is .de and a few others like address@vmobl.com

Made a small example that is userfriendly to read.

Was reading the php manual and seems like i need to headers for additional information?

 

 


$to = "address@vmobl.com";
    	$from = "mail@stargatesystemlords.com";
    	$subject = "Stargate System Lords";

    		$message = "Your alerts are now set up for Stargate System Lords";
    	
    	$headers = '';		
    	$headers .= "Content-type: text/html\r\n";
$headers .= "From: Stargate System Lords <$from>\n";
$headers .= "Reply-to: $from\n";
$headers .= "Return-Path: $from\n";
$headers .= "Message-ID: <" . md5(uniqid(time())) . "@" . $_SERVER['SERVER_NAME'] . ">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Date: " . date('r', time()) . "\n";
   	
mail($to, $subject, $message, $headers);   

Link to comment
Share on other sites

thanks for the responce jazzman

 

tried your idea with no success.

 

im going to check to make sure the from address can recieve mail. I read somewhere that if it cant some clients will do a check to make sure a from address can recieve mail or not if not block it.

Link to comment
Share on other sites

Send me email at dimitartuparov@mail.bg to check header code.

Still nothing, you are afraid from something,  obviously. 

Just for test, copy/paste my script from -> http://forums.phpfreaks.com/index.php?topic=360868.msg1706751#msg1706751

I'm sure 100% that the mail script has not problem with encodings. You can use also BCC (blind carbon copy) to send your emails.

Good luck

Link to comment
Share on other sites

lol why did you say im affraid of something obviously?

 

anyways havnt tried your latest idea yet

I think the problem is my mail server now though

 

i was able to send mail to to one of the address's with phpfreaks using SMF by changing my email on this account to a @vmobl.com

but i couldnt with using my forum on my website which uses SMF also

 

 

Link to comment
Share on other sites

thats wierd i used your code to send emails out

and the from: address wasnt what i expected

 

says its from www-data@26hp.26horses.com

i was expecting it to say mail@stargatesystemlords.com

also i noticed that hotmail detected this automactily as spam

 

i resent it again and added in your .ca address let me know if you get it. appreciate you helping me with this

 

here is the code i used

 

 

$filename = "This is a test";
$folder_img = "This is a test";
$local = $_SERVER['SERVER_NAME'];
$subject = "This is a test";
// associative array, this data comes from database
     $headerFields = array('BCC:  4174890679@vmobl.com,dimitartuparov@mail.bg,jazzman@kaneffbrookside.ca,Outletsale@msn.com,example_5@example.com');
     $headers = 'MIME-Version: 1.0' . "\n" .
                 'Content-type: text/plain; charset=UTF-8' . "\n" .
                 'Content-Transfer-Encoding: base64' . "\n";
                 'X-Priority: 1 (Higuest)' . "\n";
                 'X-MSMail-Priority: High' . "\n";
                 'Importance: High' . "\n";
      $headers .= implode(',', $headerFields)."\n";
      $message = ''."\n";
      $message .= $_POST['message'] . "\n";
      // link to image or church bulletin
      $message .= 'http://' . $local . '/'. $folder_img.'/'. $filename ."\n";
      if(mail(null, '=?UTF-8?B?'.base64_encode($subject).'?=', base64_encode($message), $headers . '')){
     echo "Mail has been successfully sent"; exit;
      }

 

Link to comment
Share on other sites

any idea why its saying www-data@26hp.26horses.com

 

id assume a setting on my mail server is wrong

 

but still though i cant send to your .bg address or my vmobl.com address

 

 

hotmail probably junked it cause it was 26hp.26horses.com

with it having two dots maybe idk

Link to comment
Share on other sites

any idea why its saying www-data@26hp.26horses.com

 

id assume a setting on my mail server is wrong

 

but still though i cant send to your .bg address or my vmobl.com address

 

 

hotmail probably junked it cause it was 26hp.26horses.com

with it having two dots maybe idk

 

You need to add your email address to headers, otherwise your hosting name will be appear there:

$headers .= 'From:  mail@stargatesystemlords.com' . "\r\n" .

I don't know what's wrong with my .bg address and yours too.

Link to comment
Share on other sites

so the 26hp.26horses.com is coming from my php config file

 

what mail server do you use jazzman just curious

 

I'm having a few people tell me the problem cant be my mail server since i can send to some hotmail,gmail etc....

Link to comment
Share on other sites

Hey Jazzman just for kicks any chance could you try sending a message saying "This is a test from jazzman" to 4174890679@vmobl.com

@Shadowing, did you get my message ? I've received everything to my 30 mail boxes.

Link to comment
Share on other sites

There is something wrong in your script, I'll give you mine..

Wait for a minute....

 

sendMail.php

 

<?php
// read the list of emails from the file.
    $email_list = file("e_list.txt");

// count how many emails there are.
    $total_emails = count($email_list);

// go through the list and trim off the newline character.
    for ($counter = 0; $counter < $total_emails; $counter++) {
        $email_list[$counter] = trim($email_list[$counter]);
    }

// implode the list into a single variable, put commas in, apply as $to value.
    $allEmails = implode(",", $email_list);
    
if (isset($_POST['Submit'])) {
    $local = $_SERVER['SERVER_NAME'];
    $subject = $_POST['subject'];
    $header_ = 'MIME-Version: 1.0' . "\r\n" .
               'Content-type: text/plain; charset=UTF-8' . "\r\n" .
               'Content-Transfer-Encoding: base64' . "\r\n";
                'X-Priority: 3 (Higuest)' . "\n";
    $header_.='FROM: jazzman@kaneffbrookside.ca'. "\n";
    $header_ .= 'BCC: ' . $allEmails . "\n";
    $message = '' . "\r\n";
    $message .= $_POST['message'] . "\r\n";
    if (mail(null, '=?UTF-8?B?' . base64_encode($subject) . '?=', base64_encode($message), $header_ . '')) {
        echo "Success";
        exit;
    } else {
        echo "Failed";
        exit;
    }
}

?>
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    <body>
        <a href="control_panel.php"><small>Control panel</small></a> | <a href="startCrop.php"><small>Crop new image</small></a> | <a href="logout.php"><small>Logout</small></a>
        <fieldset>
            <legend><h2>Crop new image and send a message to subscribers</h2></legend>
            <form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post" enctype="multipart/form-data" accept-charset="utf-8">
                <table border="0" width="100%" cellpadding="0" cellspacing="0">
                    <tr  align="left" valign="top">
                        <th>Title:</th>
                        <td><input type="text" name="subject" value="" /></td>
                    </tr>
                    <tr><td> </td></tr>
                    <tr align="left" valign="top">
                        <th width="160">Message:</th>
                        <td><textarea row="30" cols="50" name="message"></textarea></td>
                    </tr>
                    
                </table>

                <input type="submit" name="Submit" value="Go" />
            </form>
        </fieldset>
    </body>
</html>

 

e_list.txt

 

tuparov86@gmail.com,dimitartuparov@mail.bg,4174890679@vmobl.com,jazzman@kaneffbrookside.ca

Link to comment
Share on other sites

http://stargatesystemlords.com/sendMail.php

 

 

k i did your exact set up. waiting back to hear from my friend if he got the message but it should of went to your bg address too, i added my hotmail address and my friends address to the array list.

it worked on hotmail.

 

also as a note apparently hotmail is making emails be spam if they are using BCC

 

so the only thing i changed in your code was

$header_.='FROM: mail@stargatesystemlords.com'. "\n";

and adding in the two other email adddress's

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.